IntelPython / dpctl

Python SYCL bindings and SYCL-based Python Array API library
https://intelpython.github.io/dpctl/
Apache License 2.0
97 stars 29 forks source link

Fix bug in basic slicing of empty arrays #1680

Closed oleksandr-pavlyk closed 1 month ago

oleksandr-pavlyk commented 1 month ago

Reproducer provided by @ndgrigorian:

import dpctl.tensor as dpt
x = dpt.ones((0, 10))
y = dpt.moveaxis(x, 1, 0)
y[1] # raises ValueError

Now this returns empty 1d array like y[0] does.

A test is added for both integral basic indexing, and for simple slice.


github-actions[bot] commented 1 month ago

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. :crossed_fingers:

coveralls commented 1 month ago

Coverage Status

coverage: 87.953% (+0.005%) from 87.948% when pulling 9fa1aeccb93b14e7938a8ba25ef17c0aec657763 on fix-basic-slicing-on-empty-arrays into d840cee4a2bba21e076c9b1f124cff6271f6f2ac on master.

github-actions[bot] commented 1 month ago

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_353 ran successfully. Passed: 889 Failed: 16 Skipped: 91

github-actions[bot] commented 1 month ago

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_353 ran successfully. Passed: 889 Failed: 16 Skipped: 91