easyStudy question · answer published in PyTorch interview questions, so no pointsgpu-computingpytorch
Tensors on different devices
This code raises "Expected all tensors to be on the same device". What is the fix?
model = MyNet().to("cuda")
x = torch.randn(16, 128)
out = model(x)Discussion 0
Join free to post in the discussion.