Skip to content

Commit e1d2dc9

Browse files
committed
xfail indexing tests for negative slice steps
1 parent 4a6939c commit e1d2dc9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

torch_np/tests/numpy_tests/core/test_indexing.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
)
1616

1717

18+
xfail_neg_step = pytest.mark.xfail(
19+
reason="torch does not support indexing with negative slice steps"
20+
)
21+
22+
1823
class TestIndexing:
1924
def test_index_no_floats(self):
2025
a = np.array([[[5]]])
@@ -288,6 +293,7 @@ def test_boolean_indexing_list(self):
288293
assert_equal(a[b], [1, 3])
289294
assert_equal(a[None, b], [[1, 3]])
290295

296+
@xfail_neg_step
291297
def test_reverse_strides_and_subspace_bufferinit(self):
292298
# This tests that the strides are not reversed for simple and
293299
# subspace fancy indexing.
@@ -305,6 +311,7 @@ def test_reverse_strides_and_subspace_bufferinit(self):
305311
a[b, :] = c
306312
assert_equal(a[0], [0, 1])
307313

314+
@xfail_neg_step
308315
def test_reversed_strides_result_allocation(self):
309316
# Test a bug when calculating the output strides for a result array
310317
# when the subspace size was 1 (and test other cases as well)
@@ -561,6 +568,7 @@ def test_indexing_array_weird_strides(self):
561568
zind = np.zeros(4, dtype=np.intp)
562569
assert_array_equal(x2[ind, zind], x2[ind.copy(), zind])
563570

571+
@xfail_neg_step
564572
def test_indexing_array_negative_strides(self):
565573
# From gh-8264,
566574
# core dumps if negative strides are used in iteration

0 commit comments

Comments
 (0)