Question · Python course · Module 9: Machine Learning

GPU in PyTorch

How do you move a tensor to GPU in PyTorch?

Answer options

  • gpu(tensor)
  • tensor.gpu()
  • tensor.accelerate()
  • tensor.to('cuda') or tensor.cuda()

You can check the correct answer by solving this task in the CodeWorlds game.