欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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)
相关标签: 代码问题