File tree Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Expand file tree Collapse file tree 1 file changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ def test_integer_indexing(x, data):
96
96
assert result .shape == result_shape
97
97
98
98
99
+ @pytest .mark .filterwarnings (
100
+ "ignore:Creating a tensor from a list of numpy.ndarrays.*:UserWarning"
101
+ )
99
102
@given (
100
103
np_x = nps .arrays (
101
104
# We specifically use namespaced dtypes to prevent non-native byte-order issues
@@ -124,22 +127,7 @@ def test_put(np_x, data):
124
127
assert_array_equal (tnp_x , tnp_x_copy ) # sanity check
125
128
126
129
note (f"{ tnp_x = } " )
127
- tnp_ind = []
128
- list_at_ind = data .draw (
129
- st .lists (st .booleans (), min_size = len (ind ), max_size = len (ind )),
130
- label = "list_at_ind" ,
131
- )
132
- for np_indices , use_list in zip (ind , list_at_ind ):
133
- if use_list :
134
- indices = np_indices .tolist ()
135
- else :
136
- indices = tnp .asarray (np_indices ).astype (np_indices .dtype .name )
137
- tnp_ind .append (indices )
138
- tnp_ind = tuple (tnp_ind )
139
- note (f"{ tnp_ind = } " )
140
- tnp_v = tnp .asarray (v .copy ()).astype (v .dtype .name )
141
- note (f"{ tnp_v = } " )
142
- tnp .put (tnp_x , tnp_ind , tnp_v )
130
+ tnp .put (tnp_x , ind , v )
143
131
note (f"(after put) { tnp_x = } " )
144
132
145
133
assert_array_equal (tnp_x , tnp .asarray (np_x ).astype (tnp_x .dtype ))
You can’t perform that action at this time.
0 commit comments