class_docstr: Hook used to trigger the profiling features of VISSL
code: def _dump_memory_stats(self, iteration: int):
      image = self.layer_memory_tracker.show_plots(capture=True)
      image_name = (
          f"memory_rank_{self.dist_rank}_iteration_{iteration}.jpg"
      )
      image.save(os.path.join(self.output_folder, image_name))
      json_name = (
          f"memory_rank_{self.dist_rank}_iteration_{iteration}.json"
      )
      self.layer_memory_tracker.save_traces(
          os.path.join(self.output_folder, json_name)
      )
  
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 10 for calling the ProfilingHook obj's underlying member method code with example usage: obj._dump_memory_stats(iteration) without return types