class_docstr: A context manager that enables MetaTensor mode.
  
  Usage:
      >>> with MetaTensorMode():
      >>>     # all torch.xxx and torch.distributed.xxx will be replaced by patched functions
      >>>     # and the actual execution will be on torch.device('meta')
      >>>     a = torch.rand(100000, 100000)
      >>>     b = torch.rand(100000, 100000)
      >>>     c = torch.mm(a, b)
code: def __enter__(self):
      def _dummy(*args, **kwargs):
          pass
  
      def _new(*args, orig_new=torch.empty, **kwargs):
          return MetaTensor(
              orig_new(*args, **{**kwargs, "device": "meta"}),
              device=kwargs.get("device", torch.device("cpu")),
          )
  
      for func in _TorchOverrideableFactoryMethod:
          self.torch_overrides[func] = getattr(torch, func)
          setattr(
              torch, func, partial(_new, orig_new=getattr(torch, func))
          )
  
      for func in _DistCommMethod:
          self.dist_overrides[func] = getattr(dist, func)
          setattr(dist, func, _dummy)
  
imports: import uuid
  from functools import partial
  import torch
  import torch.distributed
  from torch.types import _device
  from torch.utils._pytree import tree_map
  from ._monkey_patch import _AliasATen, _DistCommMethod, _InplaceATen, _MaybeInplaceATen, _TorchOverrideableFactoryMethod
label_desc: Use image node_id 2 for calling the MetaTensorMode obj's underlying member method code with example usage: obj.__enter__() and returns: MetaTensor