class_docstr: SSL Specific variant of the Classy Vision tensorboard hook
class_docstr_tok: ["SSL","Specific","variant","of","the","Classy","Vision","tensorboard","hook"]
docstr: Called after every forward if tensorboard hook is enabled.
  Logs the model parameters if the training iteration matches the
  logging frequency.
docstr_tok: ["Called","after","every","forward","if","tensorboard","hook","is","enabled",".","Logs","the","model","parameters","if","the","training","iteration","matches","the","logging","frequency","."]
code: def on_forward(self, task: "tasks.ClassyTask") -> None:
      """
      Called after every forward if tensorboard hook is enabled.
      Logs the model parameters if the training iteration matches the
      logging frequency.
      """
      if not is_primary():
          return
  
      if self.log_activation_statistics:
          self.activation_watcher.set_iteration(task.iteration + 1)
  
      if (
          self.log_params
          and self.log_params_every_n_iterations > 0
          and task.train
          and task.iteration % self.log_params_every_n_iterations == 0
      ):
          for name, parameter in task.base_model.named_parameters():
              self.tb_writer.add_histogram(
                  f"Parameters/{name}",
                  parameter,
                  global_step=task.iteration,
              )
  
file_path: vissl/vissl/hooks/tensorboard_hook.py
imports: import logging
  import torch
  from classy_vision import tasks
  from classy_vision.generic.distributed_util import is_primary
  from classy_vision.hooks.classy_hook import ClassyHook
  from vissl.utils.activation_statistics import ActivationStatistics, ActivationStatisticsMonitor, ActivationStatisticsObserver
label_desc: Use image node_id 4 for calling the SSLTensorboardHook obj's underlying member method code with example usage: obj.on_forward(task) without return types