MSConfig
import com.mindspore.lite.config.MSConfig;
MSConfig is defined for holding environment variables during runtime.
Public Member Functions
function |
---|
public boolean init(int deviceType, int threadNum, int cpuBindMode) |
boolean init(int deviceType, int threadNum, int cpuBindMode) |
init
public boolean init(int deviceType, int threadNum, int cpuBindMode, boolean enable_float16)
Initialize MSConfig.
Parameters
deviceType
: A DeviceType enum type.-threadNum
: Thread number config for thread pool.cpuBindMode
: A CpuBindMode enum variable.enable_float16
:Whether to use float16 operator for priority.
Returns
Whether the initialization is successful.
public boolean init(int deviceType, int threadNum, int cpuBindMode)
Initialize MSConfig.
Parameters
deviceType
: A DeviceType enum type.threadNum
: Thread number config for thread pool.cpuBindMode
: A CpuBindMode enum variable.
Returns
Whether the initialization is successful.
public boolean init(int deviceType, int threadNum)
Initialize MSConfig, cpuBindMode
defaults to CpuBindMode.MID_CPU
.
Parameters
deviceType
: A DeviceType enum type.threadNum
: Thread number config for thread pool.
Returns
Whether the initialization is successful.
public boolean init(int deviceType)
Initialize MSConfig,cpuBindMode
defaults to CpuBindMode.MID_CPU
, threadNum
defaults to 2
.
Parameters
deviceType
: A DeviceType enum type.
Returns
Whether the initialization is successful.
public boolean init()
Initialize MSConfig,deviceType
defaults to DeviceType.DT_CPU
,cpuBindMode
defaults toCpuBindMode.MID_CPU
,threadNum
defaults to 2
.
Returns
Whether the initialization is successful.
free
public void free()
Free all temporary memory in MindSpore Lite MSConfig.