Package ai.djl.pytorch.engine
Class PtDeviceType
java.lang.Object
ai.djl.pytorch.engine.PtDeviceType
DeviceType is the PyTorch equivalent of the types in
Device.-
Method Summary
Modifier and TypeMethodDescriptionstatic StringfromDeviceType(int deviceType) Converts from an PyTorch device number toDevice.static inttoDeviceType(ai.djl.Device device) Converts aDeviceto the corresponding PyTorch device number.
-
Method Details
-
toDeviceType
public static int toDeviceType(ai.djl.Device device) Converts aDeviceto the corresponding PyTorch device number.- Parameters:
device- the javaDevice- Returns:
- the PyTorch device number
-
fromDeviceType
Converts from an PyTorch device number toDevice.- Parameters:
deviceType- the PyTorch device number- Returns:
- the corresponding
Device
-