ONE - On-device Neural Engine
|
Public Member Functions | |
__init__ (self, str path=None, str backends="cpu") | |
compile (self, str path, str backends="cpu") | |
inference (self) | |
Public Member Functions inherited from package.common.basesession.BaseSession | |
__getattr__ (self, name) | |
set_inputs (self, size, inputs_array=[]) | |
set_outputs (self, size) | |
Additional Inherited Members | |
Data Fields inherited from package.common.basesession.BaseSession | |
session | |
inputs | |
outputs | |
Protected Member Functions inherited from package.common.basesession.BaseSession | |
_recreate_session (self, backend_session) | |
Class for inference using nnfw_session.
Definition at line 5 of file session.py.
package.infer.session.session.__init__ | ( | self, | |
str | path = None , |
||
str | backends = "cpu" |
||
) |
Initialize the inference session. Args: path (str): Path to the model file or nnpackage directory. backends (str): Backends to use, default is "cpu".
Reimplemented from package.common.basesession.BaseSession.
Definition at line 9 of file session.py.
References package.infer.session.session.__init__(), validate_onnx2circle.OnnxRunner.session, onert::api::python::NNFW_SESSION.session, package.common.basesession.BaseSession.session, and package.common.basesession.BaseSession.set_outputs().
Referenced by package.infer.session.session.__init__().
package.infer.session.session.compile | ( | self, | |
str | path, | ||
str | backends = "cpu" |
||
) |
Prepare the session by recreating it with new parameters. Args: path (str): Path to the model file or nnpackage directory. Defaults to the existing path. backends (str): Backends to use. Defaults to the existing backends.
Definition at line 23 of file session.py.
References package.common.basesession.BaseSession._recreate_session(), validate_onnx2circle.OnnxRunner.session, onert::api::python::NNFW_SESSION.session, package.common.basesession.BaseSession.session, and package.common.basesession.BaseSession.set_outputs().
package.infer.session.session.inference | ( | self | ) |
Perform model and get outputs Returns: list: Outputs from the model.
Definition at line 39 of file session.py.
References Operation.outputs, Request.outputs, circlechef::CircleImport.outputs(), crew::Part.outputs, luci::CircleReader.outputs(), luci::PGroup.outputs, mio::circle::Reader.outputs(), moco::ModelSignature.outputs(), nnc::sir::CallFunction.outputs, validate_onnx2circle.OnnxRunner.outputs, tflinspect::Reader.outputs(), tflchef::TFliteImport.outputs(), tflread::Reader.outputs(), luci_interpreter::CircleReader.outputs(), onert_micro::core::reader::OMCircleReader.outputs(), mio::circle::Reader.outputs(), loco::Graph.outputs(), nnkit::support::onnx::Runner.outputs(), ann::Operation.outputs(), loco::Graph.outputs(), onert_micro::execute::OMRuntimeKernel.outputs, nnfw_custom_kernel_params.outputs, package.common.basesession.BaseSession.outputs, onert::exec::IODescription.outputs, run(), validate_onnx2circle.OnnxRunner.session, onert::api::python::NNFW_SESSION.session, and package.common.basesession.BaseSession.session.