class_docstr: Callback for Keras models.
docstr: Records elapse time of the batch and calculates examples per second.
docstr_tok: ["Records","elapse","time","of","the","batch","and","calculates","examples","per","second","."]
code: def on_batch_end(self, batch, logs=None):
      """Records elapse time of the batch and calculates examples per second."""
      if self.global_steps % self.log_steps == 0:
          timestamp = time.time()
          elapsed_time = timestamp - self.start_time
          examples_per_second = (
              self.batch_size * self.log_steps
          ) / elapsed_time
          self.timestamp_log.append(
              BatchTimestamp(self.global_steps, timestamp)
          )
          tf.compat.v1.logging.info(
              "BenchmarkMetric: {'global step':%d, 'time_taken': %f,"
              "'examples_per_second': %f}"
              % (self.global_steps, elapsed_time, examples_per_second)
          )
          self.start_time = timestamp
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import time
  import tensorflow
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.python import tf2
  from tensorflow.python.eager import profiler
label_desc: Use image node_id 5 for calling the TimeHistory obj's underlying member method code with example usage: obj.on_batch_end(batch, logs) without return types