1from ..native
import libnnfw_api_pybind
2from ..common.basesession
import BaseSession
7 Class for inference using nnfw_session.
9 def __init__(self, path: str =
None, backends: str =
"cpu"):
11 Initialize the inference session.
13 path (str): Path to the model file or nnpackage directory.
14 backends (str): Backends to use, default is "cpu".
17 super().
__init__(libnnfw_api_pybind.infer.nnfw_session(path, backends))
23 def compile(self, path: str, backends: str =
"cpu"):
25 Prepare the session by recreating it with new parameters.
27 path (str): Path to the model file or nnpackage directory. Defaults to the existing path.
28 backends (str): Backends to use. Defaults to the existing backends.
32 raise ValueError(
"path must not be None.")
41 Perform model and get outputs
43 list: Outputs from the model.
void run(std::ofstream &os, const circle::Model *model)
_recreate_session(self, backend_session)
__init__(self, str path=None, str backends="cpu")
compile(self, str path, str backends="cpu")