mindspore_lite.CPUDeviceInfo
- class mindspore_lite.CPUDeviceInfo(enable_fp16=False)[source]
Helper class to set cpu device info, and it inherits DeviceInfo base class.
- Parameters
enable_fp16 (bool, optional) – enables to perform the float16 inference. Default: False.
- Raises
TypeError – enable_fp16 is not a bool.
Examples
>>> import mindspore_lite as mslite >>> cpu_device_info = mslite.CPUDeviceInfo(enable_fp16=True) >>> print(cpu_device_info) device_type: DeviceType.kCPU, enable_fp16: True. >>> context = mslite.Context() >>> context.append_device_info(cpu_device_info) >>> print(context) thread_num: 0, inter_op_parallel_num: 0, thread_affinity_mode: 1, thread_affinity_core_list: [], enable_parallel: False, device_list: 0, .