Yes, very weird. The call stack seems to say somewhere at random of torch.
z = Variable(torch.randn(4, 1, 128, 128).cuda())

is the only torch.randn code that I use. Oh… I call this function not in thread or process, just at main function.