Class OnnxModel
java.lang.Object
ai.beestream.jitnn.onnx.OnnxModel
An ONNX model as read from its file: the main graph's nodes, initializers, inputs and outputs,
and the operator-set versions. Initializers stored outside the model file (ONNX external data)
are memory-mapped from their files next to it.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn attribute of a node; which fields are set depends on its type.static final recordA graph: its nodes in topological order, the initializers (weights and constants) by name, and its inputs and outputs.static final recordA node of the graph: an operator application, with the names of its input and output values.static final recordA tensor stored in the model: dims, element type and its data as little-endian bytes.static final recordA graph input or output: name, element type and dims (-1 for a symbolic dimension), with the symbolic dimensions' names (dim_param, null where a dimension has none or dims is null). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intONNX data type: bfloat16.static final intONNX data type: boolean, one byte.static final intONNX data type: 64-bit float.static final intONNX data type: 32-bit float.static final intONNX data type: IEEE 16-bit float.static final intONNX data type: 16-bit signed integer.static final intONNX data type: 32-bit signed integer.static final intONNX data type: 64-bit signed integer.static final intONNX data type: 8-bit signed integer.static final intONNX data type: 16-bit unsigned integer.static final intONNX data type: 8-bit unsigned integer. -
Method Summary
Modifier and TypeMethodDescriptiongraph()The model's main graph.static OnnxModelReads an ONNX model file; initializers kept in external data files next to it are memory-mapped.static OnnxModelof(OnnxModel.Graph graph, Map<String, Long> opsets) A model from a graph built in memory (by jitNN's other importers), with its operator-set versions.longThe operator-set version ofdomain("" is the default ONNX domain).
-
Field Details
-
FLOAT
public static final int FLOATONNX data type: 32-bit float.- See Also:
-
UINT8
public static final int UINT8ONNX data type: 8-bit unsigned integer.- See Also:
-
INT8
public static final int INT8ONNX data type: 8-bit signed integer.- See Also:
-
UINT16
public static final int UINT16ONNX data type: 16-bit unsigned integer.- See Also:
-
INT16
public static final int INT16ONNX data type: 16-bit signed integer.- See Also:
-
INT32
public static final int INT32ONNX data type: 32-bit signed integer.- See Also:
-
INT64
public static final int INT64ONNX data type: 64-bit signed integer.- See Also:
-
BOOL
public static final int BOOLONNX data type: boolean, one byte.- See Also:
-
FLOAT16
public static final int FLOAT16ONNX data type: IEEE 16-bit float.- See Also:
-
DOUBLE
public static final int DOUBLEONNX data type: 64-bit float.- See Also:
-
BFLOAT16
public static final int BFLOAT16ONNX data type: bfloat16.- See Also:
-
-
Method Details
-
of
A model from a graph built in memory (by jitNN's other importers), with its operator-set versions. -
graph
The model's main graph. -
opset
The operator-set version ofdomain("" is the default ONNX domain). -
load
Reads an ONNX model file; initializers kept in external data files next to it are memory-mapped.- Throws:
IOException
-