RuntimeError                              Traceback (most recent call last)
 in 
28
29         # Make weight updates
—> 30         optimizer.step()
31
32         # Empty cuda cache to clear useless data from VRAM for better utilization
~/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/autograd/grad_mode.py in decorate_context(*args, **kwargs)
13         def decorate_context(*args, **kwargs):
14             with self:
—> 15                 return func(*args, **kwargs)
16         return decorate_context
17
~/anaconda3/envs/pytorch/lib/python3.8/site-packages/torch/optim/adam.py in step(self, closure)
97
98                 # Decay the first and second moment running average coefficient
—> 99                 exp_avg.mul_(beta1).add_(grad, alpha=1 - beta1)
100                 exp_avg_sq.mul_(beta2).addcmul_(grad, grad, value=1 - beta2)
101                 if amsgrad:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!