You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dpctl.tensor.astype raises ValueError with empty list as input #728
import dpctl.tensor as dpt
a = dpt.asarray([])
dpt.astype(a, float)
Output:
Traceback (most recent call last):
File "/localdisk/work/plukiche/dpnp_fork/dpctl_empty_astype_repro.py", line 4, in <module>
dpt.astype(a, float)
File "/localdisk/work/plukiche/miniconda/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_copy_utils.py", line 447, in astype
_copy_from_usm_ndarray_to_usm_ndarray(R, usm_ary)
File "/localdisk/work/plukiche/miniconda/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_copy_utils.py", line 282, in _copy_from_usm_ndarray_to_usm_ndarray
copy_same_shape(dst, src)
File "/localdisk/work/plukiche/miniconda/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_copy_utils.py", line 239, in copy_same_shape
copy_same_dtype(dst, src)
File "/localdisk/work/plukiche/miniconda/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_copy_utils.py", line 197, in copy_same_dtype
if _has_memory_overlap(dst, src):
File "/localdisk/work/plukiche/miniconda/miniconda3/envs/dpnptc4_internal/lib/python3.8/site-packages/dpctl/tensor/_copy_utils.py", line 69, in _has_memory_overlap
m1 = dpm.as_usm_memory(x1)
File "dpctl/memory/_memory.pyx", line 736, in dpctl.memory._memory.as_usm_memory
File "dpctl/memory/_memory.pyx", line 203, in dpctl.memory._memory._Memory._cinit_other
File "dpctl/memory/_sycl_usm_array_interface_utils.pxi", line 185, in dpctl.memory._memory._USMBufferData.from_sycl_usm_ary_iface
File "dpctl/memory/_sycl_usm_array_interface_utils.pxi", line 83, in dpctl.memory._memory._pointers_from_shape_and_stride
ValueError: Array shape elements need to be positive
In [5]: import dpctl.tensor as dpt
...:
...: a = dpt.asarray([])
In [6]: b = dpt.asarray([], 'd')
In [7]: b[...] = a
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Activity
LukichevaPolina commentedon Jan 13, 2022
@oleksandr-pavlyk, Could you please look at this problem?
densmirn commentedon Jan 21, 2022
@oleksandr-pavlyk, could you please either leave a comment or prepare a fix on this issue? The issue is blocking DPNP testing in external CI.
oleksandr-pavlyk commentedon Feb 1, 2022
The issue is with the logic of copying:
Fixed #728
Fixes #728
Fixed #728
Tests added for problem from #728
Merge pull request #757 from IntelPython/bugfix/gh-728-astype
Fixed #728
Tests added for problem from #728