mindspore_lite.ModelExecutor
- class mindspore_lite.ModelExecutor(executor=None)[source]
The ModelExecutor class wraps multiple mindspore_lite models and implements their inference scheduling.
- Parameters
executor (_c_lite_wrapper.ModelExecBind, optional) – ModelExecutor class wrapped with pybind11. Default:
None.
- get_inputs()[source]
Obtains all input Tensors of the ModelExecutor.
- Returns
list[Tensor], the input Tensor list of the ModelExecutor.
- get_outputs()[source]
" Obtains all output information Tensors of the ModelExecutor.
- Returns
list[TensorMeta], the output TensorMeta list of the ModelExecutor.
- predict(inputs, outputs=None)[source]
Inference ModelExecutor.
- Parameters
- Returns
list[Tensor], the output Tensor list of the ModelExecutor.
- Raises
TypeError – inputs is not a list.
TypeError – outputs is not a list.
TypeError – inputs is a list, but the elements are not Tensor.
TypeError – outputs is a list, but the elements are not Tensor.
RuntimeError – predict model failed.