class_docstr: Hook used to trigger the profiling features of VISSL
docstr: Called after parameter update.
code: def on_update(self, task: "tasks.ClassyTask") -> None:
      """
      Called after parameter update.
      """
      iteration = task.local_iteration_num
      next_iteration = iteration + 1
  
      if self.profile_by_layer_memory:
          self._memory_tracking(iteration, task)
      if self.profile_runtime:
          self._runtime_tracking(iteration, task)
      if (
          self.interrupt_training
          and next_iteration >= self.end_iteration + 1
      ):
          self._interrupt_training(iteration)
  
imports: import logging
  import os
  import torch
  import torch.nn
  from classy_vision import tasks
  from classy_vision.hooks.classy_hook import ClassyHook
  from fairscale.nn import FullyShardedDataParallel
  from fairscale.nn.misc import FlattenParamsWrapper
  from torch.nn import SyncBatchNorm
  from vissl.config.attr_dict import AttrDict
  from vissl.utils.env import get_machine_local_and_dist_rank
  from vissl.utils.layer_memory_tracking import LayerwiseMemoryTracker
  from vissl.utils.profiler import create_runtime_profiler
label_desc: Use image node_id 6 for calling the ProfilingHook obj's underlying member method code with example usage: obj.on_update(task) without return types