Package ai.djl.pytorch.engine
Class PtDeviceType
- java.lang.Object
-
- ai.djl.pytorch.engine.PtDeviceType
-
public final class PtDeviceType extends java.lang.ObjectDeviceType is the PyTorch equivalent of the types inDevice.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringfromDeviceType(int deviceType)Converts from an PyTorch device number toDevice.static inttoDeviceType(ai.djl.Device device)Converts aDeviceto the corresponding PyTorch device number.
-
-
-
Method Detail
-
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
public static java.lang.String fromDeviceType(int deviceType)
Converts from an PyTorch device number toDevice.- Parameters:
deviceType- the PyTorch device number- Returns:
- the corresponding
Device
-
-