Class PtDeviceType

java.lang.Object
ai.djl.pytorch.engine.PtDeviceType

public final class PtDeviceType extends Object
DeviceType is the PyTorch equivalent of the types in Device.
  • Method Details

    • toDeviceType

      public static int toDeviceType(ai.djl.Device device)
      Converts a Device to the corresponding PyTorch device number.
      Parameters:
      device - the java Device
      Returns:
      the PyTorch device number
    • fromDeviceType

      public static String fromDeviceType(int deviceType)
      Converts from an PyTorch device number to Device.
      Parameters:
      deviceType - the PyTorch device number
      Returns:
      the corresponding Device