Skip to content

Commit

Permalink
Fix unit test failure caused by the keras initializer change.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 453982185
  • Loading branch information
qlzh727 authored and tensorflower-gardener committed Jun 9, 2022
1 parent a506d3a commit 44848e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions official/nlp/modeling/layers/tn_expand_condense_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def test_keras_layer(self, input_dim, proj_multiple):
def test_train(self, input_dim, proj_multiple):
data = np.random.randint(10, size=(100, input_dim))
model = self._build_model(data, proj_multiple)
tf.random.set_seed(0)
tf.keras.utils.set_random_seed(0)

model.compile(
optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
Expand All @@ -81,7 +81,7 @@ def test_train(self, input_dim, proj_multiple):

@parameterized.parameters((768, 6), (1024, 2))
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))
model = self._build_model(data, proj_multiple)
model.compile(
Expand Down

0 comments on commit 44848e0

Please sign in to comment.