tensor([-4.9389e+23, 4.5758e-41]), while
tensor(2). I coud’t find the manual for torch.Tensor, and it’s very confusing of these two object constructor. What’s the reason to define ‘torch.Tensor’ when ‘torch.tensor’ is already defined?
torch.Tensor uses uninitialized memory, so you shouldn’t use it.
torch.tensor creates a new tensor using the passed values.
I found the usage in
self.weight = Parameter(torch.Tensor(num_features))
torch.Tensor is not recommended?
Yes, don’t use it.
reset_parameters() afterwards, which will initialize these tensors.
Ok, thanks for the reply!