royboy:

That constructor doesn’t do anything to the storage memory, it’s all uninitialized. So the data is just garbage.


But still, garbage have a value that can be  represented  by a number, right? If they have a number, how come pytorch knows it’s garbage or a useful number? And why sometims I get a number for calculate the mean, and sometimes I get a nan?