Difference between torch.zeros and torch.Tensor

Initializing anything with torch.Tensor gives extremely small values close to zero, while torch.zeros gives exactly zero. I am not getting in what cases should one use torch.Tensor?

Hi,
torch.Tensor does not initialize the memory, so you get whatever was there before.
torch.zeros actually zero out the memory so you get a Tensor full of 0.

2 Likes