ah, you’re correct. I’m used to tensor to which is out of place. It might be better habit to re-assign, as I have seen a number of mistakes where a tensor.to(device) was assumed to be in-place.
In [14]: net=torch.nn.Linear(3,4)
In [15]: net.weight.device
Out[15]: device(type='cpu')
In [16]: net.to('cuda')
Out[16]: Linear(in_features=3, out_features=4, bias=True)
In [17]: net.weight.device
Out[17]: device(type='cuda', index=0)