class_docstr: Helper class to create graphs to display memory
class_docstr_tok: ["Helper","class","to","create","graphs","to","display","memory"]
code: def _split_forward_backward(
      cls, memory_traces: List[LayerMemoryTrace], values
  ):
      x_values = np.array(list(range(len(memory_traces))))
      mask_forwards, mask_backwards = cls._mask_forward_backward(
          memory_traces
      )
      return (
          x_values,
          np.ma.masked_where(mask_backwards, values),
          np.ma.masked_where(mask_forwards, values),
      )
  
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 9 for calling the MemoryGraphCreator obj's underlying member method code with example usage: obj._split_forward_backward(cls, memory_traces, values) and returns: x_values,  np,  np