@@ -78,7 +78,7 @@ def bool_getitem(self, key):
7878 x_shape = py_tuple (self .shape )
7979 key_shape = py_tuple (key .shape )
8080 if key .ndim > self .ndim or py_any (
81- ks not in (xs , 0 ) for xs , ks in zip (x_shape , key_shape )
81+ ks not in (xs , 0 ) for xs , ks in zip (x_shape , key_shape , strict = False )
8282 ):
8383 raise IndexError ("boolean index did not match indexed array" )
8484 if key .ndim == 0 :
@@ -100,13 +100,13 @@ def high_dim_int_getitem(self, key):
100100 if not py_all (isinstance (k , py_int ) and not isinstance (k , py_bool ) for k in key ):
101101 return None
102102 normalized = []
103- for k , side in zip (key , shape ):
103+ for k , side in zip (key , shape , strict = True ):
104104 k = k + side if k < 0 else k
105105 if k < 0 or k >= side :
106106 raise IndexError ("index out of bounds" )
107107 normalized .append (k )
108108 flat_index = 0
109- for k , stride in zip (normalized , _strides (shape )):
109+ for k , stride in zip (normalized , _strides (shape ), strict = True ):
110110 flat_index += k * stride
111111 return _tf .gather (_tf .reshape (self , (- 1 ,)), flat_index )
112112
0 commit comments