Skip to content

Commit f786954

Browse files
hawkinsptensorflower-gardener
authored andcommitted
[numpy] Fix test failures under NumPy 2.2.
PiperOrigin-RevId: 704330083
1 parent 06e37bf commit f786954

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tf_keras/constraints_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ def test_min_max_norm(self):
9999
normed = norm_instance(backend.variable(array))
100100
value = backend.eval(normed)
101101
l2 = np.sqrt(np.sum(np.square(value), axis=0))
102-
assert not l2[l2 < m]
103-
assert not l2[l2 > m * 2 + 1e-5]
102+
assert l2[l2 < m].size == 0
103+
assert l2[l2 > m * 2 + 1e-5].size == 0
104104

105105
def test_conv2d_radial_constraint(self):
106106
for width in (3, 4, 5, 6):

0 commit comments

Comments
 (0)