docstr: Create a Parameter or Tensor with the same properties of the uninitialized one.
  
  Given a shape, it materializes a parameter in the same device
  and with the same `dtype` as the current one or the specified ones in the
  arguments.
  
  Args:
      shape : (tuple): the shape for the materialized tensor.
      device (:class:`torch.device`): the desired device of the parameters
          and buffers in this module. Optional.
      dtype (:class:`torch.dtype`): the desired floating point type of
          the floating point parameters and buffers in this module. Optional.
docstr_tok: ["Create","a","Parameter","or","Tensor","with","the","same","properties","of","the","uninitialized","one",".","Given","a","shape",",","it","materializes","a","parameter","in","the","same","device","and","with","the","same","`","dtype","`","as","the","current","one","or","the","specified","ones","in","the","arguments",".","Args",":","shape",":","(","tuple",")",":","the","shape","for","the","materialized","tensor",".","device","(",":","class",":","`","torch.device","`",")",":","the","desired","device","of","the","parameters","and","buffers","in","this","module",".","Optional",".","dtype","(",":","class",":","`","torch.dtype","`",")",":","the","desired","floating","point","type","of","the","floating","point","parameters","and","buffers","in","this","module",".","Optional","."]
code: def materialize(self, shape, device=None, dtype=None):
      r"""Create a Parameter or Tensor with the same properties of the uninitialized one.
  
      Given a shape, it materializes a parameter in the same device
      and with the same `dtype` as the current one or the specified ones in the
      arguments.
  
      Args:
          shape : (tuple): the shape for the materialized tensor.
          device (:class:`torch.device`): the desired device of the parameters
              and buffers in this module. Optional.
          dtype (:class:`torch.dtype`): the desired floating point type of
              the floating point parameters and buffers in this module. Optional.
      """
      if device is None:
          device = self.data.device
      if dtype is None:
          dtype = self.data.dtype
      self.data = torch.empty(shape, device=device, dtype=dtype)
      self.__class__ = self.cls_to_become
  
imports: import torch
  from torch._C import _disabled_torch_function_impl
  from collections import OrderedDict
label_desc: Use image node_id 1 for calling the UninitializedTensorMixin obj's underlying member method code with example usage: obj.materialize(shape, device, dtype) without return types