Class PtDeviceType


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String fromDeviceType​(int deviceType)
      Converts from an PyTorch device number to Device.
      static int toDeviceType​(ai.djl.Device device)
      Converts a Device to the corresponding PyTorch device number.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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 java.lang.String fromDeviceType​(int deviceType)
        Converts from an PyTorch device number to Device.
        Parameters:
        deviceType - the PyTorch device number
        Returns:
        the corresponding Device