mindspore_lite.AscendDeviceInfo

class mindspore_lite.AscendDeviceInfo(device_id=0)[source]

Helper class to set Ascend device infos, and it inherits DeviceInfo base class.

Parameters

device_id (int, optional) – The device id. Default: 0.

Raises

Examples

>>> import mindspore_lite as mslite
>>> ascend_device_info = mslite.AscendDeviceInfo(device_id=0)
>>> print(ascend_device_info)
device_type: DeviceType.kAscend,
device_id: 0.
>>> cpu_device_info = mslite.CPUDeviceInfo(enable_fp16=False)
>>> context = mslite.Context()
>>> context.append_device_info(ascend_device_info)
>>> 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: 3, 0, .