MlModel backend that runs .onnx graphs through ONNX Runtime with a cached CPU session.
More...
#include <ml_onnx_model.h>
Public Member Functions | |
| MlOnnxModel () | |
| ~MlOnnxModel () override | |
| MlTensor | predict (const MlTensor &input) const override |
| bool | save (const QString &path) const override |
| bool | load (const QString &path) override |
| QString | modelType () const override |
| MlTaskType | taskType () const override |
| bool | isLoaded () const |
| Public Member Functions inherited from MLLIB::MlModel | |
| virtual | ~MlModel ()=default |
Additional Inherited Members | |
| Public Types inherited from MLLIB::MlModel | |
| typedef QSharedPointer< MlModel > | SPtr |
MlModel backend that runs .onnx graphs through ONNX Runtime with a cached CPU session.
When mne-cpp is configured without USE_ONNXRUNTIME every method either throws std::runtime_error (predict) or returns false / logs a warning (load, save), so the same client code compiles and links on minimal builds and on WebAssembly without conditional call sites.
Definition at line 79 of file ml_onnx_model.h.

| MlOnnxModel::MlOnnxModel | ( | ) |
Default constructor.
Definition at line 77 of file ml_onnx_model.cpp.
|
override |
Destructor.
Definition at line 83 of file ml_onnx_model.cpp.
| bool MlOnnxModel::isLoaded | ( | ) | const |
Definition at line 221 of file ml_onnx_model.cpp.
|
overridevirtual |
Load a model from disk.
| [in] | path | File path. |
Implements MLLIB::MlModel.
Definition at line 151 of file ml_onnx_model.cpp.
|
overridevirtual |
Implements MLLIB::MlModel.
Definition at line 232 of file ml_onnx_model.cpp.
Run inference on the given input tensor.
| [in] | input | The input data. |
Implements MLLIB::MlModel.
Definition at line 90 of file ml_onnx_model.cpp.
|
overridevirtual |
Serialise the model to disk.
| [in] | path | File path. |
Implements MLLIB::MlModel.
Definition at line 142 of file ml_onnx_model.cpp.
|
overridevirtual |
Implements MLLIB::MlModel.
Definition at line 239 of file ml_onnx_model.cpp.