class_docstr: Context manager for lazy initialization. Enables initializing the model without allocating real memory.
  
  Args:
      tensor_cls (Union[_MyTensor, LazyTensor], optional): This is only for test. Defaults to LazyTensor.
      default_device (Optional[Union[torch.device, str, int]], optional): Defalt device for initialization.
          If it's cuda, initilization will be accelerated, but cuda memory will be allocated. By default, it's cpu.
          Defaults to None.
class_docstr_tok: ["Context","manager","for","lazy","initialization",".","Enables","initializing","the","model","without","allocating","real","memory",".","Args",":","tensor_cls","(","Union","[","_MyTensor",",","LazyTensor","]",",","optional",")",":","This","is","only","for","test",".","Defaults","to","LazyTensor",".","default_device","(","Optional","[","Union","[","torch.device",",","str",",","int","]","]",",","optional",")",":","Defalt","device","for","initialization",".","If","it","'s","cuda",",","initilization","will","be","accelerated",",","but","cuda","memory","will","be","allocated",".","By","default",",","it","'s","cpu",".","Defaults","to","None","."]
code: def __init__(
      self,
      tensor_cls: Union[_MyTensor, LazyTensor] = LazyTensor,
      default_device: Optional[Union[torch.device, str, int]] = None,
  ):
      assert tensor_cls is LazyTensor or tensor_cls is _MyTensor
      self.tensor_cls = tensor_cls
      self.old_default_device = LazyTensor.default_device
      self.default_device = default_device
  
imports: from types import MethodType
  from typing import Callable, Optional, Union
  import torch
  import torch.nn
  from packaging import version
  from torch import Tensor
  from torch.nn import Parameter
  from torch.utils._pytree import tree_map
  from colossalai.logging import get_dist_logger
  from .construction import ConstructorManager
  from .pretrained import PretrainedManager
  import colossalai._analyzer._subclasses._meta_registration
label_desc: Use image node_id 1 to create a new LazyInitContext object  with example: obj = LazyInitContext(tensor_cls, default_device)