Besides, another problem is how to get nan in PyTorch.
Ok, this is solved, since the type(nan) shows that it’s float, which could be examined with math.isnan(x)
But the NaN problem above is remained unsolved…