```
To specify the desired shape, you can either use a tuple (e.g., torch.zeros((2, 3))) or variable arguments (e.g., torch.zeros(2, 3)) in most cases.



Name
Returned Tensor
torch.*_like variant
tensor.new_* variant




torch.empty
uninitialized memory
✔
✔


torch.zeros
all zeros
✔
✔


torch.ones
all ones
✔
✔


torch.full
filled with a given value
✔
✔


torch.rand
i.i.d. continuous Uniform[0, 1)
✔



torch.randn
i.i.d. Normal(0, 1)
✔



