MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / on_batch

Method on_batch

tensorflow/python/keras/engine/training_v2.py:703–715  ·  view source on GitHub ↗

Provide a scope for running one batch.

(self, step=0, mode=ModeKeys.TRAIN, size=1)

Source from the content-addressed store, hash-verified

701
702 @tf_contextlib.contextmanager
703 def on_batch(self, step=0, mode=ModeKeys.TRAIN, size=1):
704 """Provide a scope for running one batch."""
705 batch_logs = {'batch': step, 'size': size}
706 self.callbacks._call_batch_hook(
707 mode, 'begin', step, batch_logs)
708 self.progbar.on_batch_begin(step, batch_logs)
709 try:
710 yield batch_logs
711 finally:
712 if not batch_logs.pop('data_exhausted', False):
713 self.callbacks._call_batch_hook(
714 mode, 'end', step, batch_logs)
715 self.progbar.on_batch_end(step, batch_logs)

Callers 1

run_one_epochFunction · 0.80

Calls 4

_call_batch_hookMethod · 0.80
on_batch_beginMethod · 0.45
popMethod · 0.45
on_batch_endMethod · 0.45

Tested by

no test coverage detected