Skip to content
RED SAG Skills
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)
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions