Package ai.onnxruntime
Enum OnnxJavaType
- java.lang.Object
-
- java.lang.Enum<OnnxJavaType>
-
- ai.onnxruntime.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).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static OnnxJavaTypemapFromClass(java.lang.Class<?> clazz)Maps from a Java class object into the enum type, returningUNKNOWNfor unsupported types.static OnnxJavaTypemapFromInt(int value)Maps from an int in native land into an OnnxJavaType instance.static OnnxJavaTypemapFromOnnxTensorType(TensorInfo.OnnxTensorType onnxValue)Maps from theTensorInfo.OnnxTensorTypeenum to the corresponding OnnxJavaType enum, converting types as appropriate.static OnnxJavaTypevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static OnnxJavaType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
FLOAT
public static final OnnxJavaType FLOAT
-
DOUBLE
public static final OnnxJavaType DOUBLE
-
INT8
public static final OnnxJavaType INT8
-
INT16
public static final OnnxJavaType INT16
-
INT32
public static final OnnxJavaType INT32
-
INT64
public static final OnnxJavaType INT64
-
BOOL
public static final OnnxJavaType BOOL
-
STRING
public static final OnnxJavaType STRING
-
UINT8
public static final OnnxJavaType UINT8
-
UNKNOWN
public static final OnnxJavaType UNKNOWN
-
-
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()) System.out.println(c);
- Returns:
- 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.)- 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 namejava.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.- Parameters:
value- The value to lookup.- Returns:
- The enum instance.
-
mapFromOnnxTensorType
public static OnnxJavaType mapFromOnnxTensorType(TensorInfo.OnnxTensorType onnxValue)
Maps from theTensorInfo.OnnxTensorTypeenum to the corresponding OnnxJavaType enum, converting types as appropriate.Must match the values from OrtJniUtil.c.
- Parameters:
onnxValue- The native value type.- Returns:
- 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, returningUNKNOWNfor unsupported types.- Parameters:
clazz- The class to use.- Returns:
- An OnnxJavaType instance.
-
-