Olá :)
quando eu uso .to(device) tenho o seguinte erro:
Traceback (most recent call last): File "/home/jardel/projects/alura/Python/pytorch/training-neural-network/main.py", line 34, in pred = net(Xtns) ^^^^^^^^^ ... RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu! (when checking argument for argument mat1 in method wrapper_CUDA_addmm)
quando eu remove o .to(device) o código funciona.
Faltava fazer o casting no Xtns: Xtns = Xtns.to(device)