File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
torch_np/tests/numpy_tests/core Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -121,11 +121,19 @@ def test_void_scalar_empty_tuple(self):
121
121
assert_equal (s [()], s )
122
122
assert_equal (type (s [...]), np .ndarray )
123
123
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
+ )
124
132
def test_same_kind_index_casting (self ):
125
133
# Indexes should be cast with same-kind and not safe, even if that
126
134
# is somewhat unsafe. So test various different code paths.
127
135
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
129
137
arr = np .arange (10 )
130
138
131
139
assert_array_equal (arr [index ], arr [u_index ])
You can’t perform that action at this time.
0 commit comments