set torch module device code example
Example: setting device in torch
. You can use the tensor.to(device) command to move a tensor to a device. The .to() command is also used to move a whole model to a device, like in the post you linked to. to set cuda as your device if possible