Skip to content

Commit

Permalink
Update Keras test, Model() no longer supports deeply nested input/out…
Browse files Browse the repository at this point in the history
…put lists.
  • Loading branch information
yatbear committed Nov 14, 2023
1 parent 3a4099d commit 8187aea
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tensorboard/plugins/hparams/_keras_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def mock_time():
initial_time = mock_time.time
with mock.patch("time.time", mock_time):
self._initialize_model(writer=self.logdir)
self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
self.model.fit(x=[1], y=[2], callbacks=[self.callback])
final_time = mock_time.time

files = os.listdir(self.logdir)
Expand Down Expand Up @@ -136,7 +136,7 @@ def test_explicit_writer(self):
filename_suffix=".magic",
)
self._initialize_model(writer=writer)
self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
self.model.fit(x=[1], y=[2], callbacks=[self.callback])

files = os.listdir(self.logdir)
self.assertEqual(len(files), 1, files)
Expand All @@ -152,15 +152,15 @@ def test_non_eager_failure(self):
with self.assertRaisesRegex(
RuntimeError, "only supported in TensorFlow eager mode"
):
self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
self.model.fit(x=[1], y=[2], callbacks=[self.callback])

def test_reuse_failure(self):
self._initialize_model(writer=self.logdir)
self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
self.model.fit(x=[1], y=[2], callbacks=[self.callback])
with self.assertRaisesRegex(
RuntimeError, "cannot be reused across training sessions"
):
self.model.fit(x=[(1,)], y=[(2,)], callbacks=[self.callback])
self.model.fit(x=[1], y=[2], callbacks=[self.callback])

def test_invalid_writer(self):
with self.assertRaisesRegex(
Expand Down

0 comments on commit 8187aea

Please sign in to comment.