context 1008

This commit is contained in:
dingpeifei 2021-10-08 10:45:59 +08:00
parent ddee167d97
commit 57e8c3d834
1 changed files with 4 additions and 1 deletions

View File

@ -528,7 +528,7 @@ def set_context(**kwargs):
Note:
Attribute name is required for setting attributes.
The mode is not recommended to be changed after net was initialized because the implementations of some
The mode is not recommended being changed after net was initialized because the implementations of some
operations are different in graph mode and pynative mode. Default: GRAPH_MODE.
Some configurations are device specific, see the below table for details:
@ -792,6 +792,9 @@ def get_context(attr_key):
Raises:
ValueError: If input key is not an attribute in context.
Examples:
>>> context.get_context("device_target")
>>> context.get_context("device_id")
"""
ctx = _context()
device = ctx.get_param(ms_ctx_param.device_target)