pytorch 同步gpu
import torch a = torch.tensor([[1, 2, 3],[4, 5, 6]]) b = torch.tensor([[2, 2, 2], [3, 3, 3], [3, 3, 3], [3, 3, 3]]) a=a.to(b.device)

pytorch 同步gpu
import torch a = torch.tensor([[1, 2, 3],[4, 5, 6]]) b = torch.tensor([[2, 2, 2], [3, 3, 3], [3, 3, 3], [3, 3, 3]]) a=a.to(b.device)