Skip to content

Commit

Permalink
Fix format.
Browse files Browse the repository at this point in the history
  • Loading branch information
qlzh727 committed Oct 23, 2023
1 parent aa46847 commit cb1abe3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion keras/backend/common/variables_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,11 @@ def test_variable_numpy(self):
)
def test_variable_numpy_scalar(self):
from keras.utils.module_utils import tensorflow as tf

strategy = tf.distribute.MirroredStrategy(["cpu:0", "cpu:1"])
with strategy.scope():
v = backend.Variable(initializer=0.0)

np_value = backend.convert_to_numpy(v)
self.assertIsInstance(np_value, np.ndarray)
self.assertAllClose(np_value, 0.0)
Expand Down

0 comments on commit cb1abe3

Please sign in to comment.