It looks like this happens randomly.
I mean code sometimes runs without error but the other time code complains error,
saying “expected float cuda tensor”.
I checked the tensor was on the CPU device which was supposed to be on the GPU
and tensor was filled with all 0s.
Why does this happen and how can I solve this?