class_docstr: Trace event providing the current memory usage at a point
  occuring during the forward or backward
  
      module_name: name of the module under processing
      module_params: size of the module parameters
      allocated: state of the PyTorch allocated memory
      reserved: state of the PyTorch reserved memory
      is_forward: whether the trace was collected during forward
      all_gathered: memory gathered since last event by FSDP
      cumul_all_gathered: total amount of memory currently gathered by FSDP
      event: additional information on the trace
class_docstr_tok: ["Trace","event","providing","the","current","memory","usage","at","a","point","occuring","during","the","forward","or","backward","module_name",":","name","of","the","module","under","processing","module_params",":","size","of","the","module","parameters","allocated",":","state","of","the","PyTorch","allocated","memory","reserved",":","state","of","the","PyTorch","reserved","memory","is_forward",":","whether","the","trace","was","collected","during","forward","all_gathered",":","memory","gathered","since","last","event","by","FSDP","cumul_all_gathered",":","total","amount","of","memory","currently","gathered","by","FSDP","event",":","additional","information","on","the","trace"]
code: def to_dict(self):
      return {
          "module_name": self.module_name,
          "module_params": self.module_params,
          "allocated": self.allocated,
          "reserved": self.reserved,
          "is_forward": self.is_forward,
          "all_gathered": self.all_gathered,
          "cumul_all_gathered": self.cumul_all_gathered,
          "event": self.event.to_dict(),
      }
  
imports: from contextlib import contextmanager
  from dataclasses import dataclass
  from enum import auto, Enum
  from functools import lru_cache
  from typing import Dict, List, NamedTuple, Tuple, Union
  import numpy
  import torch
  import torch.nn
  from fairscale.nn import FullyShardedDataParallel
  from vissl.utils.visualize import matplotlib_figure_to_image
label_desc: Use image node_id 1 for calling the LayerMemoryTrace obj's underlying member method code with example usage: obj.to_dict() and returns: dict