Skip to content

Commit 4bbbffa

Browse files
committed
Conversion to numpy before calling numpy operations
1 parent 9d87656 commit 4bbbffa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test_links/test_links.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ def test_positive_definite(positive_definite, batch_size, num_variables):
5858
# Too strongly negative values lead to numerical instabilities -> reduce scale
5959
random_preactivation = keras.random.normal(input_shape) * 0.1
6060
output = positive_definite(random_preactivation)
61+
output = keras.ops.convert_to_numpy(output)
6162

6263
# Check if output is invertible
6364
np.linalg.inv(output)
6465

6566
# Calculated eigenvalues to test for positive definiteness
66-
output = keras.ops.convert_to_numpy(output)
6767
eigenvalues = np.linalg.eig(output).eigenvalues
6868

6969
assert np.all(eigenvalues.real > 0) and np.all(np.isclose(eigenvalues.imag, 0)), (

0 commit comments

Comments
 (0)