When debugging my code, I found that torch.rand() sometimes can generate very big numbers.
A fraction of my code:
u1 = Variable(torch.rand(mu.size()).cuda())
u2 = Variable(torch.rand(mu.size()).cuda())
if mu.data.dim() == 6:
print(‘u1’, u1.data.max())
print(torch.rand(1))
Printed result (I use two GPUs):
u1 4293885184.0
u1 4293885184.0
1.6911e+09
[torch.FloatTensor of size 1]
1.6911e+09
[torch.FloatTensor of size 1]
My pytorch is compiled 3 weeks ago. Is it the problem of torch.rand()? Thanks for help!