Skip to content

Commit a91d006

Browse files
Update BackupAndRestore class example (#20714)
* Update BackupAndRestore class example * Update backup_and_restore.py --------- Co-authored-by: François Chollet <[email protected]>
1 parent 2c95bfe commit a91d006

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

keras/src/callbacks/backup_and_restore.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class BackupAndRestore(Callback):
3737
>>> callback = keras.callbacks.BackupAndRestore(backup_dir="/tmp/backup")
3838
>>> model = keras.models.Sequential([keras.layers.Dense(10)])
3939
>>> model.compile(keras.optimizers.SGD(), loss='mse')
40+
>>> model.build(input_shape=(None, 20))
4041
>>> try:
4142
... model.fit(np.arange(100).reshape(5, 20), np.zeros(5), epochs=10,
4243
... batch_size=1, callbacks=[callback, InterruptingCallback()],

0 commit comments

Comments
 (0)