get_device#
- composer.utils.get_device(device)[source]#
Takes string or Device and returns the corresponding
Device.- Parameters
device (str | Device, optional) โ A string corresponding to a device (one of
'cpu','gpu','mps', or'tpu') or aDevice.- Returns
Device โ Device corresponding to the passed string or Device. If no argument is passed, returns
DeviceGPUif available, orDeviceCPUif no GPU is available.