class_docstr: Run in ``TorchDispatchMode`` to get memory stats at operator level.
class_docstr_tok: ["Run","in","``","TorchDispatchMode","``","to","get","memory","stats","at","operator","level","."]
code: def __init__(self, memory_tracker) -> None:
      self.memory_tracker = memory_tracker
  
imports: from collections import defaultdict
  from itertools import chain
  import pickle
  from typing import Any, Callable, Dict, List, no_type_check, Sequence
  import torch
  import torch.nn
  from torch.utils.hooks import RemovableHandle
  from torch.utils._python_dispatch import TorchDispatchMode
label_desc: Use image node_id 1 to create a new MemoryProfileDispatchMode object from inherited base classes: TorchDispatchMode with example: obj = MemoryProfileDispatchMode(memory_tracker)