MODULE REFERENCE
onnx
anomx.models.onnxInference from portable ONNX model artifacts.
classView source ↗
ONNXModel
ONNXModel(path: str | Path | bytes, *, providers: list[str] | None = None)Bases: Model
Run a published graph without importing or unpickling Python model code.
| Parameter | Type | Default |
|---|---|---|
path | str | Path | bytes | required |
providerskeyword only | list[str] | None | None |
Members
predictmethod
predict(observations: ArrayLike) -> np.ndarrayPredict a batch of (batch, input_window, channels) observations.
| Parameter | Type | Default |
|---|---|---|
observations | ArrayLike | required |
Returns np.ndarray
runmethod
run(inputs: Mapping[str, ArrayLike]) -> dict[str, Any]Run named ONNX tensors and return JSON-compatible named outputs.
Supports numeric, boolean and string tensors, including models with multiple inputs/outputs. The runtime validates tensor dimensions.
| Parameter | Type | Default |
|---|---|---|
inputs | Mapping[str, ArrayLike] | required |
Returns dict[str, Any]
Inherited members
is_component_abstractBaseComponentget_component_typeBaseComponentget_component_keyBaseComponentget_component_nameBaseComponentget_component_docsBaseComponentget_component_descriptionBaseComponentget_component_iconBaseComponentget_component_image_pathBaseComponentget_component_statusBaseComponentget_component_default_configBaseComponentget_component_config_schemaBaseComponentget_component_code_versionBaseComponentget_component_source_pathBaseComponentget_component_import_pathBaseComponentget_component_capabilitiesBaseComponentget_component_signatureBaseComponentget_component_parametersBaseComponentget_configBaseComponent