Skip to content

Commit

Permalink
Merge pull request #548 from IntelPython/bugfix/gh-547
Browse files Browse the repository at this point in the history
Fixes #547
  • Loading branch information
oleksandr-pavlyk authored Aug 24, 2021
2 parents 6e0a5bb + 315b9aa commit d0d6529
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
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

0 comments on commit d0d6529

Please sign in to comment.