Enum NNAPIFlags

  • All Implemented Interfaces:
    OrtFlags, java.io.Serializable, java.lang.Comparable<NNAPIFlags>

    public enum NNAPIFlags
    extends java.lang.Enum<NNAPIFlags>
    implements OrtFlags
    Flags for the NNAPI provider.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CPU_DISABLED
      Disables NNAPI from using CPU.
      CPU_ONLY
      NNAPI will only use CPU.
      USE_FP16
      Enables fp16 support.
      USE_NCHW
      Uses channels first format.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int value
      The native value of the enum.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getValue()
      Gets the underlying flag value.
      static NNAPIFlags valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static NNAPIFlags[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • USE_FP16

        public static final NNAPIFlags USE_FP16
        Enables fp16 support.
      • USE_NCHW

        public static final NNAPIFlags USE_NCHW
        Uses channels first format. Only recommended for developer usage to validate code changes to the execution provider implementation.
      • CPU_DISABLED

        public static final NNAPIFlags CPU_DISABLED
        Disables NNAPI from using CPU. If an operator could be assigned to NNAPI, but NNAPI only has a CPU implementation of that operator on the current device, model load will fail.
      • CPU_ONLY

        public static final NNAPIFlags CPU_ONLY
        NNAPI will only use CPU. Only recommended for developer usage as it significantly impacts performance.
    • Field Detail

      • value

        public final int value
        The native value of the enum.
    • Method Detail

      • values

        public static NNAPIFlags[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (NNAPIFlags c : NNAPIFlags.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static NNAPIFlags valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public int getValue()
        Description copied from interface: OrtFlags
        Gets the underlying flag value.
        Specified by:
        getValue in interface OrtFlags
        Returns:
        The flag value.