sciai.context.set_context_auto
- sciai.context.set_context_auto(mode=ms.GRAPH_MODE, device_id=None)[source]
Automatically set context as given mode, recognize platform. If device_id is None, no card would be set.
- Parameters
- Raises
ValueError – If device_id is illegal.
- Supported Platforms:
GPU
CPU
Ascend
Examples
>>> import mindspore as ms >>> from sciai.context import set_context_auto >>> set_context_auto(mode=ms.GRAPH_MODE, device_id=2)