Commit 2bc29a6f authored by Scott Zhu's avatar Scott Zhu Committed by A. Unique TensorFlower
Browse files

Fix unit test failure caused by the keras initializer change.

PiperOrigin-RevId: 453982185
parent 7c3fd62e
...@@ -66,7 +66,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase): ...@@ -66,7 +66,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
def test_train(self, input_dim, proj_multiple): def test_train(self, input_dim, proj_multiple):
data = np.random.randint(10, size=(100, input_dim)) data = np.random.randint(10, size=(100, input_dim))
model = self._build_model(data, proj_multiple) model = self._build_model(data, proj_multiple)
tf.random.set_seed(0) tf.keras.utils.set_random_seed(0)
model.compile( model.compile(
optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
...@@ -81,7 +81,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase): ...@@ -81,7 +81,7 @@ class TNLayerTest(tf.test.TestCase, parameterized.TestCase):
@parameterized.parameters((768, 6), (1024, 2)) @parameterized.parameters((768, 6), (1024, 2))
def test_weights_change(self, input_dim, proj_multiple): def test_weights_change(self, input_dim, proj_multiple):
tf.random.set_seed(0) tf.keras.utils.set_random_seed(0)
data = np.random.randint(10, size=(100, input_dim)) data = np.random.randint(10, size=(100, input_dim))
model = self._build_model(data, proj_multiple) model = self._build_model(data, proj_multiple)
model.compile( model.compile(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment