class_docstr: Complementary trace event collected during the forward pass
  to trace the memory increase and the memory taken by activations
class_docstr_tok: ["Complementary","trace","event","collected","during","the","forward","pass","to","trace","the","memory","increase","and","the","memory","taken","by","activations"]
code: def from_dict(cls, serialized):
      return TraceForwardEvent(
          memory_diff=serialized["memory_diff"],
          memory_activations=serialized["memory_activations"],
      )
  
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 2 for calling the TraceForwardEvent obj's underlying member method code with example usage: obj.from_dict(cls, serialized) and returns: TraceForwardEvent