Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
fchollet committed Jul 15, 2024
1 parent 24b8536 commit 576daec
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions keras/src/backend/tensorflow/optimizer_distribute_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ def test_config(self):
@parameterized.parameters([("keras_sgd",), ("tf_keras_sgd",)])
def test_single_step(self, optimizer_type):
if optimizer_type == "tf_keras_sgd":
import tf_keras
try:
import tf_keras

optimizer_fn = tf_keras.optimizers.SGD
optimizer_fn = tf_keras.optimizers.SGD
except (ImportError, AttributeError):
self.skipTest("tf_keras not installed")
else:
optimizer_fn = SGD
with self.strategy.scope():
Expand Down

0 comments on commit 576daec

Please sign in to comment.