RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the
程序员文章站
2024-01-05 16:22:34
...
RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
inputs = inputs.to(device)