PyTorch torch.empty function
PyTorch torch reference manual
torch.empty is a PyTorch function for creating an uninitialized tensor.
Function definition
torch.empty(*size, dtype=None, device=None, requires_grad=False)
Usage examples
Example
import
torch
Create an uninitialized tensor
x
=
torch.
empty
(
3
,
4
)
(
x
)
(
"Note: values are uninitialized memory values"
)