解決PyTorch報錯:RuntimeError: Expected object of backend CPU but got backend CUDA for argument #2 'other

1. 問題描述 在利用PyTorch報錯:python RuntimeError: Expected object of backend CPU but got backend CUDA for argument #2 'other' 報錯時,對應Python語句的寫法爲:web update_scale = torch.max(scale.round(), torch.Tensor([2]))
相關文章
相關標籤/搜索