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","."]
code: def _get_cum_sample_fetch_times(
      self, phase_type
  ) -> Tuple[List[float], ...]:
      if not self.sample_fetch_times:
          return None
  
      sample_fetch_times = torch.Tensor(self.sample_fetch_times)
      max_sample_fetch_times = all_reduce_max(
          sample_fetch_times
      ).tolist()
      cum_sample_fetch_times = list(
          accumulate(
              [self.state.cum_sample_fetch_time[phase_type]]
              + max_sample_fetch_times
          )
      )[1:]
      self.state.cum_sample_fetch_time[
          phase_type
      ] = cum_sample_fetch_times[-1]
      return cum_sample_fetch_times
  
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 6 for calling the TensorboardPlotHook obj's underlying member method code with example usage: obj._get_cum_sample_fetch_times(phase_type) and returns: cum_sample_fetch_times, None