get_device

lib.torch_utils.get_device(cpu: bool = False) device

Get the correctly configured device for running Torch

Parameters:

cpu (bool) – True to force running on the CPU.

Return type:

The device that torch should use