RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same 原因 Input type and weight type not be same fixed device = torch.device("cpu") model = MyModel() model.to(device) input.to(device) model(input) # cpu or cuda is the same