Commit 9fa1aec
committed
Fix bug in basic slicing of empty arrays
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.1 parent d840cee commit 9fa1aec
2 files changed
+35
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | | - | |
| 127 | + | |
126 | 128 | | |
127 | 129 | | |
128 | 130 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
138 | 143 | | |
139 | | - | |
| 144 | + | |
| 145 | + | |
140 | 146 | | |
141 | | - | |
142 | | - | |
| 147 | + | |
| 148 | + | |
143 | 149 | | |
144 | 150 | | |
145 | 151 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 454 | | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
455 | 479 | | |
456 | 480 | | |
457 | 481 | | |
| |||
0 commit comments