Skip to content

Commit 7af6183

Browse files
committed
Selectively xfail test_too_many_advanced_indices
1 parent 4b8852a commit 7af6183

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

torch_np/tests/numpy_tests/core/test_indexing.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,9 @@ def test_too_many_advanced_indices(self, index, num, original_ndim):
611611
# These are limitations based on the number of arguments we can process.
612612
# For `num=32` (and all boolean cases), the result is actually define;
613613
# but the use of NpyIter (NPY_MAXARGS) limits it for technical reasons.
614+
if not (isinstance(index, np.ndarray) and original_ndim < num):
615+
# non-xfail cases fail because of assigning too many indices
616+
pytest.xfail("torch does not limit dims to 32")
614617
arr = np.ones((1,) * original_ndim)
615618
with pytest.raises(IndexError):
616619
arr[(index,) * num]

0 commit comments

Comments
 (0)