Skip to content

Commit 5ffcf86

Browse files
Fixes #547
Property `__sycl_usm_array_interface__` is to use `self.shape` rather than call _make_int_tuple directly. ``` In [4]: dpt.usm_ndarray(tuple(), dtype='d').__sycl_usm_array_interface__ Out[4]: {'data': (94536841949184, True), 'shape': (), 'strides': None, 'typestr': '|f8', 'version': 1, 'syclobj': <dpctl.SyclQueue at 0x7f5bbeb3f780>, 'offset': 0} ```
1 parent 6e0a5bb commit 5ffcf86

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-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:

0 commit comments

Comments
 (0)