Solved by user_123454321 in post #5 
              
              
                Can you try maybe 
alpha = alpha.to(device)

I think the ‘to’ function is not in-place…this is what I get when I run in my termnal… 
>>> a = torch.tensor([1., 2., 3.])
>>> a.to('cuda:0')
tensor([1., 2., 3.], device='cuda:0')
>>> a
tensor([1., 2., 3.])
>>> a = a.to('cuda:0')
>>> a
tensor([1., 2., 3.]…