Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dpctl/tensor/_usmarray.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ cdef class usm_ndarray:
buffer can be strings ('device'|'shared'|'host' to allocate new memory)
or dpctl.memory.MemoryUSM* buffers, or usm_ndrray instances.
"""
cdef int nd = 9
cdef int nd = 0
cdef int typenum = 0
cdef int itemsize = 0
cdef int err = 0
Expand Down Expand Up @@ -304,7 +304,7 @@ cdef class usm_ndarray:
ary_ptr = <char *>(<size_t> self.data_)
ro_flag = False if (self.flags_ & USM_ARRAY_WRITEABLE) else True
ary_iface['data'] = (<size_t> ary_ptr, ro_flag)
ary_iface['shape'] = _make_int_tuple(self.nd_, self.shape_)
ary_iface['shape'] = self.shape
if (self.strides_):
ary_iface['strides'] = _make_int_tuple(self.nd_, self.strides_)
else:
Expand Down
1 change: 1 addition & 0 deletions dpctl/tests/test_usm_ndarray_ctor.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_allocate_usm_ndarray(shape, usm_type):
assert X.sycl_device == q.sycl_device
assert X.size == Xnp.size
assert X.shape == Xnp.shape
assert X.shape == X.__sycl_usm_array_interface__["shape"]


@pytest.mark.parametrize(
Expand Down