RuntimeError: expected device cpu but got device cuda:0 input = input.cuda() RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same model.cuda()