class_docstr: This callback writes the training throughput (in terms of either steps/sec, or samples/sec)
  to the monitors everytime it is triggered.
  The throughput is computed based on the duration between the consecutive triggers.
  
  The time spent on callbacks after each epoch is excluded.
class_docstr_tok: ["This","callback","writes","the","training","throughput","(","in","terms","of","either","steps\/sec",",","or","samples\/sec",")","to","the","monitors","everytime","it","is","triggered",".","The","throughput","is","computed","based","on","the","duration","between","the","consecutive","triggers",".","The","time","spent","on","callbacks","after","each","epoch","is","excluded","."]
code: def _trigger(self):
      steps_per_sec = (
          self.global_step - self._last_step
      ) / self._timer.seconds()
      self._update_last()
  
      if self._samples_per_step is None:
          self.trainer.monitors.put_scalar(
              "Throughput (steps/sec)", steps_per_sec
          )
      else:
          self.trainer.monitors.put_scalar(
              "Throughput (samples/sec)",
              steps_per_sec * self._samples_per_step,
          )
  
imports: import multiprocessing
  import numpy
  import os
  import time
  import tensorflow
  from six.moves import map, queue
  import psutil
  from ..tfutils.common import gpu_available_in_session
  from ..utils import logger
  from ..utils.timer import Timer
  from ..utils.concurrency import ensure_proc_terminate, start_proc_mask_signal
  from ..utils.gpu import get_num_gpu
  from ..utils.nvml import NVMLContext
  from .base import Callback
label_desc: Use image node_id 6 for calling the ThroughputTracker obj's underlying member method code with example usage: obj._trigger() without return types