Enum OnnxJavaType

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

    public enum OnnxJavaType
    extends java.lang.Enum<OnnxJavaType>
    An enum representing onnxruntime supported Java primitive types (and String).
    • Field Detail

      • value

        public final int value
      • clazz

        public final java.lang.Class<?> clazz
      • size

        public final int size
    • Method Detail

      • values

        public static OnnxJavaType[] 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 (OnnxJavaType c : OnnxJavaType.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static OnnxJavaType 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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • mapFromInt

        public static OnnxJavaType mapFromInt​(int value)
        Maps from an int in native land into an OnnxJavaType instance.
        value - The value to lookup.
        The enum instance.
      • mapFromOnnxTensorType

        public static OnnxJavaType mapFromOnnxTensorType​(TensorInfo.OnnxTensorType onnxValue)
        Maps from the TensorInfo.OnnxTensorType enum to the corresponding OnnxJavaType enum, converting types as appropriate.

        Must match the values from OrtJniUtil.c.

        onnxValue - The native value type.
        A OnnxJavaType instance representing the Java type
      • mapFromClass

        public static OnnxJavaType mapFromClass​(java.lang.Class<?> clazz)
        Maps from a Java class object into the enum type, returning UNKNOWN for unsupported types.
        clazz - The class to use.
        An OnnxJavaType instance.