Skip to content

Commit d0d6529

Browse files
Merge pull request #548 from IntelPython/bugfix/gh-547
Fixes #547
2 parents 6e0a5bb + 315b9aa commit d0d6529

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

dpctl/tensor/_usmarray.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ cdef class usm_ndarray:
118118
buffer can be strings ('device'|'shared'|'host' to allocate new memory)
119119
or dpctl.memory.MemoryUSM* buffers, or usm_ndrray instances.
120120
"""
121-
cdef int nd = 9
121+
cdef int nd = 0
122122
cdef int typenum = 0
123123
cdef int itemsize = 0
124124
cdef int err = 0
@@ -304,7 +304,7 @@ cdef class usm_ndarray:
304304
ary_ptr = <char *>(<size_t> self.data_)
305305
ro_flag = False if (self.flags_ & USM_ARRAY_WRITEABLE) else True
306306
ary_iface['data'] = (<size_t> ary_ptr, ro_flag)
307-
ary_iface['shape'] = _make_int_tuple(self.nd_, self.shape_)
307+
ary_iface['shape'] = self.shape
308308
if (self.strides_):
309309
ary_iface['strides'] = _make_int_tuple(self.nd_, self.strides_)
310310
else:

dpctl/tests/test_usm_ndarray_ctor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def test_allocate_usm_ndarray(shape, usm_type):
5555
assert X.sycl_device == q.sycl_device
5656
assert X.size == Xnp.size
5757
assert X.shape == Xnp.shape
58+
assert X.shape == X.__sycl_usm_array_interface__["shape"]
5859

5960

6061
@pytest.mark.parametrize(

0 commit comments

Comments
 (0)