PyTorch torch.empty Function
Pytorch torch Reference Manual
torch.emptyis a function in PyTorch used to create uninitialized tensors.
Function Definition
torch.empty(*size, dtype=None, device=None, requires_grad=False)
Usage Example
Example
import torch
# Create an uninitialized tensor
x = torch.empty(3, 4)
print(x)
print("Note: The values are uninitialized memory values")
# Create an uninitialized tensor
x = torch.empty(3, 4)
print(x)
print("Note: The values are uninitialized memory values")
Other Extensions