Skip to content

Commit c1de2f0

Browse files
committed
xfail test_same_kind_index_casting
1 parent 6220a2c commit c1de2f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

torch_np/tests/numpy_tests/core/test_indexing.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,19 @@ def test_void_scalar_empty_tuple(self):
121121
assert_equal(s[()], s)
122122
assert_equal(type(s[...]), np.ndarray)
123123

124+
@pytest.mark.xfail(
125+
reason=(
126+
"torch does not support integer indexing int tensors with uints - "
127+
"you can't integer index int tensors with anything but a int64 "
128+
"tensor, and uint8 tensor indexes are treated as boolean masks "
129+
"(deprecated behaviour). "
130+
)
131+
)
124132
def test_same_kind_index_casting(self):
125133
# Indexes should be cast with same-kind and not safe, even if that
126134
# is somewhat unsafe. So test various different code paths.
127135
index = np.arange(5)
128-
u_index = index.astype(np.uintp)
136+
u_index = index.astype(np.uintp) # i.e. cast to default uint indexing dtype
129137
arr = np.arange(10)
130138

131139
assert_array_equal(arr[index], arr[u_index])

0 commit comments

Comments
 (0)