For instance, I can’t find Tensor.new in the documentation. I also tried
from torch import Tensor
print(Tensor.new.__doc__)
in my console, but no words appeared. Besides, I remember there are some other pytorch functions that are without documentation, but I can’t recall any name of them right now so I just take Tensor.new as an example.
Some methods are not properly documented as these are mainly used in internal code. E.g. the new() call returns a tensor in a new shape with uninitialized memory:
x = torch.tensor(1)
print(x)
# tensor(1)
y = x.new(2)
print(y)
# tensor([3616445622929465956, 6066685342842367284])
Thanks for your immediate reply! I am used to writing new_empty, but when I read other users’ codes with new, I may get confused since there’s no documentation.