pytorching:

x.mean() output nan, because it has both negative and positive values, which will accumulate to Inf and -Inf and that’s why there’s nan in the tensor.


No, that’s not the case as seen in my example, as I’m already using the max. float16 values and they are not accumulating to Inf (internally float32 will be used so the overflow will not happen).



 pytorching:

Could you try it again with this link?


Thanks for the new link as I was able to download the data.
Your input data already contains Inf values, which will create the NaN output in x.mean():
print(torch.isinf(x).any())
> tensor(True, device='cuda:0')