Skip to content

Commit edf9333

Browse files
committed
Fix TensorFlow CI failures
1 parent 40837ae commit edf9333

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/array_api_compat/tensorflow/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

src/array_api_compat/tensorflow/_aliases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,9 @@ def full(
666666
del kwargs
667667
if isinstance(shape, int):
668668
shape = (shape,)
669-
value = tf.convert_to_tensor(fill_value, dtype=dtype)
670669
with tf.device(device):
671-
return tf.fill(shape, value)
670+
value = _to_tensor(fill_value, dtype=dtype)
671+
return tf.broadcast_to(value, shape)
672672

673673

674674
def full_like(

0 commit comments

Comments
 (0)