class_docstr: Hook for writing the losses, learning rates and meters to `tensorboard <https
  ://www.tensorflow.org/tensorboard`>_.
  
  Global steps are counted in terms of the number of samples processed.
class_docstr_tok: ["Hook","for","writing","the","losses",",","learning","rates","and","meters","to","`","tensorboard","<","https",":","\/\/www.tensorflow.org\/tensorboard","`",">","_",".","Global","steps","are","counted","in","terms","of","the","number","of","samples","processed","."]
docstr: Store the observed learning rates.
docstr_tok: ["Store","the","observed","learning","rates","."]
code: def on_step(self, task) -> None:
      """Store the observed learning rates."""
      self.state.step_count[task.phase_type] += 1
      self.wall_times.append(time.time())
      if "sample_fetch_time" in task.last_batch.step_data:
          self.sample_fetch_times.append(
              task.last_batch.step_data["sample_fetch_time"]
          )
      if task.train:
          self.learning_rates.append(task.optimizer.options_view.lr)
  
file_path: ClassyVision/classy_vision/hooks/tensorboard_plot_hook.py
imports: import logging
  import time
  from itertools import accumulate
  from typing import Any, Dict, List, Optional, Tuple
  import torch
  from classy_vision.generic.distributed_util import all_reduce_max, is_primary
  from classy_vision.hooks import register_hook
  from classy_vision.hooks.classy_hook import ClassyHook
label_desc: Use image node_id 5 for calling the TensorboardPlotHook obj's underlying member method code with example usage: obj.on_step(task) without return types