RunnerConfig

View Source On Gitee

RunnerConfig defines the configuration parameters of MindSpore Lite concurrent inference.

Public Member Functions

function

Supported At Cloud-side Inference

Supported At Device-side Inference

boolean init()

public boolean init(MSContext msContext)

public void setWorkerNum(int workerNum)

public void setConfigInfo(String section, HashMap<String, String> config)

public void setConfigPath(String configPath)

void getConfigPath()

long getRunnerConfigPtr()

public void setDeviceIds(ArrayList<Integer> deviceIds)

public ArrayList<Integer> getDeviceIds()

init

public boolean init()

Configuration parameter initialization for parallel inference.

  • Returns

    Whether the initialization is successful.

public boolean init(MSContext msContext)

Configuration parameter initialization for parallel inference.

  • Parameters

    • msContext: Context configuration for concurrent inference runtime.

  • Returns

    Whether the initialization is successful.

setWorkerNum

public void setWorkerNum(int workerNum)

The parameter setting of the number of models in parallel inference.

  • Parameters

    • workerNum: Set the number of models in the configuration.

setConfigInfo

public void setConfigInfo(String section, HashMap<String, String> config)

Model configuration parameter settings in parallel inference.

  • Parameters

    • section: Configured chapter name.

    • config: config pair to update.

setConfigPath

public void setConfigPath(String configPath)

Set the configuration file path in concurrent inference.

  • Parameters

    • configPath: config path.

getConfigPath

public String getConfigPath()

Get the path to the configuration file set in RunnerConfig.

  • Returns

    config path.

getRunnerConfigPtr

public long getRunnerConfigPtr()

Get a pointer to the underlying concurrent inference configuration parameters.

  • Returns

    Low-level concurrent inference configuration parameter pointer.

setDeviceIds

public void setDeviceIds(ArrayList<Integer> deviceIds)

Set the list of device id in concurrent inference.

  • Parameters

    • deviceIds: list of device id.

getDeviceIds

public ArrayList<Integer> getDeviceIds()

Get the list of device id set in RunnerConfig.

  • Returns

    list of device id.