336 Star 1.5K Fork 868

MindSpore / docs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_parallel_runner.md 2.48 KB
一键复制 编辑 原始数据 按行查看 历史
宦晓玲 提交于 2023-07-21 16:52 . modify the md links 1.8

ModelParallelRunner

View Source On Gitee

import com.mindspore.config.RunnerConfig;

ModelParallelRunner defines MindSpore Lite concurrent inference.

Public Member Functions

function
long getModelParallelRunnerPtr()
boolean init()
boolean predict()
boolean getInputs()
boolean getOutputs()
void free()

getModelParallelRunnerPtr

public long getModelParallelRunnerPtr()

Get the underlying concurrent inference class pointer.

  • Returns

    Low-level concurrent inference class pointer.

init

public boolean init(String modelPath, RunnerConfig runnerConfig)

Read and load models according to the path, generate one or more models, and compile all models to a state that can be run on the Device.

  • Parameters

    • modelPath: model file path.

    • runnerConfig: A RunnerConfig structure. Defines configuration parameters for the concurrent inference model.

  • Returns

    Whether the initialization is successful.

public boolean init(String modelPath)

Read and load models according to the path, generate one or more models, and compile all models to a state that can be run on the Device.

  • Parameters

    • modelPath: model file path.
  • Returns

    Whether the initialization is successful.

predict

public boolean predict(List<MSTensor> inputs, List<MSTensor> outputs)

Concurrent inference model.

  • Parameters

    • inputs: model input.

    • outputs: model output.

  • Returns

    Whether the inference is successful.

getInputs

public List<MSTensor> getInputs()

Get all input tensors of the model.

  • Returns

    A list of input tensors for the model.

getOutputs

public List<MSTensor> getOutputs()

Get all input tensors of the model.

  • Returns

    A list of output tensors for the model.

free

public void free()

Free concurrent inference class memory.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/mindspore/docs.git
git@gitee.com:mindspore/docs.git
mindspore
docs
docs
r1.8

搜索帮助

344bd9b3 5694891 D2dac590 5694891