Skip to content

Commit e3bfab8

Browse files
qlzh727tensorflower-gardener
authored andcommitted
Minor update to the unit test for the upcoming Keras RNG change.
PiperOrigin-RevId: 413582073
1 parent b04c6c4 commit e3bfab8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tensorflow_model_optimization/python/core/clustering/keras/cluster_integration_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,10 @@ def on_train_batch_begin(self, batch, logs=None):
335335
self.bias = (self.model.layers[0].layer.bias.numpy())
336336

337337
def on_train_batch_end(self, batch, logs=None):
338+
# Skip the first batch since the update from the start of training is
339+
# too small.
340+
if not batch:
341+
return
338342
# Check weights are different after batch
339343
assert not np.array_equal(
340344
self.original_weight_kernel,

0 commit comments

Comments
 (0)