torch.empty — PyTorch 2.12 documentation
Returns a tensor filled with uninitialized data. The shape of the tensor is defined by the variable argument size. Note If torch.use_deterministic_algorithms() and torch.utils.deterministic.fill_uninitialized_memory are both set to True, the output tensor is initialized to prevent any possible nondeterministic behavior from using the data as an input to an operation. Floating point and complex tensors are filled with NaN, and integer tensors are filled with the maximum value. size (int...) – a sequence of integers defining the shape of the output tensor. Can be a variable number of arguments or a collection like a list or tuple. out (Tensor, optional) – the output tensor. dtype (torch.dtype, optional) – the desired data type of returned tensor. Default: if None, uses a global default (see torch.set_default_dtype()). layout (torch.layout, optional) – the desired layout of returned Tensor. Default: torch.strided. device (torch.device, optional) – the desired device of returned tensor. De
torch.empty # torch. empty ( *size , * , out=None , dtype=None , layout=torch.strided , device=None , requires_grad=False , pin_memory=False , memory_format=torch.contiguous_format ) → Tensor # Returns a tensor filled with uninitialized data. The shape of the tensor is defined by the variable argument size . Note If torch.use_deterministic_algorithms() and torch.utils.deterministic.fill_uninitialized_memory are both set to True , the output tensor is initialized to prevent any possible nondeterministic behavior from using the data as an input to an operation. Floating point and complex
Explore this link on the map →related reading
- torch.zeros_like — PyTorch 2.12 documentationdocs.pytorch.org
- torch.ones_like — PyTorch 2.12 documentationdocs.pytorch.org
- torch.randn — PyTorch 2.12 documentationdocs.pytorch.org
- torch.Tensor — PyTorch 2.12 documentationdocs.pytorch.org
- PyTorch internals : ezyang's blogblog.ezyang.com
- Tensors — PyTorch Tutorials 2.12.0+cu130 documentationpytorch.org
- the bug that taught me more about PyTorch than years of using it | Elana Simonelanapearl.github.io
- Tensors — PyTorch Tutorials 2.13.0+cu130 documentationdocs.pytorch.org
- Redirecting…docs.pytorch.org
- torch.normal — PyTorch 2.12 documentationdocs.pytorch.org
- torch.Tensor.uniform_ — PyTorch 2.12 documentationdocs.pytorch.org
- PiTorch: ML on Baremetal Raspberry Pis | projectsmasonjwang.com