mindspore_lite.CPUDeviceInfo
- class mindspore_lite.CPUDeviceInfo(enable_fp16=False)[源代码]
用于描述CPU设备硬件信息的辅助类,继承
mindspore_lite.DeviceInfo
基类。- 参数:
enable_fp16 (bool,可选) - 是否启用执行Float16推理。默认值:False。
- 异常:
TypeError - enable_fp16 不是bool类型。
样例:
>>> 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: 0, thread_affinity_core_list: [], enable_parallel: False, device_list: 0, .