15
15
)
16
16
17
17
18
+ xfail_neg_step = pytest .mark .xfail (
19
+ reason = "torch does not support indexing with negative slice steps"
20
+ )
21
+
22
+
18
23
class TestIndexing :
19
24
def test_index_no_floats (self ):
20
25
a = np .array ([[[5 ]]])
@@ -288,6 +293,7 @@ def test_boolean_indexing_list(self):
288
293
assert_equal (a [b ], [1 , 3 ])
289
294
assert_equal (a [None , b ], [[1 , 3 ]])
290
295
296
+ @xfail_neg_step
291
297
def test_reverse_strides_and_subspace_bufferinit (self ):
292
298
# This tests that the strides are not reversed for simple and
293
299
# subspace fancy indexing.
@@ -305,6 +311,7 @@ def test_reverse_strides_and_subspace_bufferinit(self):
305
311
a [b , :] = c
306
312
assert_equal (a [0 ], [0 , 1 ])
307
313
314
+ @xfail_neg_step
308
315
def test_reversed_strides_result_allocation (self ):
309
316
# Test a bug when calculating the output strides for a result array
310
317
# when the subspace size was 1 (and test other cases as well)
@@ -561,6 +568,7 @@ def test_indexing_array_weird_strides(self):
561
568
zind = np .zeros (4 , dtype = np .intp )
562
569
assert_array_equal (x2 [ind , zind ], x2 [ind .copy (), zind ])
563
570
571
+ @xfail_neg_step
564
572
def test_indexing_array_negative_strides (self ):
565
573
# From gh-8264,
566
574
# core dumps if negative strides are used in iteration
0 commit comments