Package ai.onnxruntime
Enum Class OnnxJavaType
- All Implemented Interfaces:
Serializable,Comparable<OnnxJavaType>,Constable
An enum representing ONNX Runtime supported Java primitive types (and String).
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA non-IEEE 16-bit floating point value, with 8 exponent bits and 7 mantissa bits.A boolean value stored in a single byte.A 64-bit floating point value.A 32-bit floating point value.A IEEE 16-bit floating point value.A 16-bit signed integer value.A 32-bit signed integer value.A 64-bit signed integer value.An 8-bit signed integer value.A UTF-8 string.A 8-bit unsigned integer value.An unknown type used as an error condition or a sentinel. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic OnnxJavaTypemapFromClass(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 OnnxJavaTypeReturns the enum constant of this class with the specified name.static OnnxJavaType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
FLOAT
A 32-bit floating point value. -
DOUBLE
A 64-bit floating point value. -
INT8
An 8-bit signed integer value. -
INT16
A 16-bit signed integer value. -
INT32
A 32-bit signed integer value. -
INT64
A 64-bit signed integer value. -
BOOL
A boolean value stored in a single byte. -
STRING
A UTF-8 string. -
UINT8
A 8-bit unsigned integer value. -
FLOAT16
A IEEE 16-bit floating point value. -
BFLOAT16
A non-IEEE 16-bit floating point value, with 8 exponent bits and 7 mantissa bits. -
UNKNOWN
An unknown type used as an error condition or a sentinel.
-
-
Field Details
-
value
public final int valueThe native value of the enum. -
clazz
The Java side type used as the carrier. -
size
public final int sizeThe number of bytes used by a single value of this type.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
mapFromInt
Maps from an int in native land into an OnnxJavaType instance.- Parameters:
value- The value to lookup.- Returns:
- The enum instance.
-
mapFromOnnxTensorType
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
Maps from a Java class object into the enum type, returningUNKNOWNfor unsupported types.- Parameters:
clazz- The class to use.- Returns:
- An OnnxJavaType instance.
-