Hello, thank you very much for your help but when I try to send the optimizer to gpu(.cuda()) I get an error
AttributeError                            Traceback (most recent call last)
<ipython-input-10-e7bad7cb8ff5> in <module>
      1 import torch.optim as optim
      2 loss_fn = nn.CrossEntropyLoss()
----> 3 opt = optim.Adam(net.parameters()).cuda()

AttributeError: 'Adam' object has no attribute 'cuda'

import torch.optim as optim loss_fn = nn.CrossEntropyLoss() opt = optim.Adam(net.parameters()).cuda()