make sure you call model.cuda() or model.to(device)so the model will run on GPU.
Instead of writing predlist=torch.cat([predlist,y_pred_targets.view(-1).cpu()]) you should keep all your tensors on GPU so just keep predlist=torch.cat([predlist,y_pred_targets.view(-1)]) and predlist=torch.zeros(0,dtype=torch.long, device=device)  where device refers to your GPU. Then at the end you just make predlist=predlist.cpu() if your code require numpy arrays.