mindspore/docs/api/api_python/hal/mindspore.hal.is_available.rst

13 lines
536 B
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.hal.is_available
=============================
.. py:function:: mindspore.hal.is_available(device_target)
查询目标设备是否可用,此接口将在后续版本中废弃,请使用接口 :func:`mindspore.device_context.cpu.is_available`:func:`mindspore.device_context.gpu.is_available`:func:`mindspore.device_context.ascend.is_available` 代替。
参数:
- **device_target** (str) - 目标设备,可选值为 ``"CPU"`` ``"GPU"`` 以及 ``"Ascend"``
返回:
bool