class_docstr: Save profiles in specified step range to log directory.
code: def on_batch_end(self, batch, logs=None):
      if batch == self.stop_step_in_epoch and self.should_stop:
          self.should_stop = False
          results = profiler.stop()
          profiler.save(self.log_dir, results)
          tf.compat.v1.logging.info(
              "Profiler saved profiles for steps between %s and %s to %s",
              self.start_step,
              self.stop_step,
              self.log_dir,
          )
  
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 4 for calling the ProfilerCallback obj's underlying member method code with example usage: obj.on_batch_end(batch, logs) without return types