!22464 modify description of context pynative synchronize

Merge pull request !22464 from chujinjin/code_docs_pynative_sync_control
This commit is contained in:
i-robot 2021-08-28 02:40:43 +00:00 committed by Gitee
commit 6501ebb658
1 changed files with 6 additions and 2 deletions

View File

@ -663,8 +663,12 @@ def set_context(**kwargs):
you should make sure the network has not been changed since the last execution. By now, we have
not support automatically checking the changes yet. Default: False.
This is an experimental prototype that is subject to change and/or deletion.
pynative_synchronize (bool): Whether to enable asynchronous execution of the device in Pynative mode.
Default: False.
pynative_synchronize (bool): Whether to enable synchronous execution of the device in Pynative mode.
Default: False. When the value is set to False, the operator is executed asynchronously on the device.
When an error occurs in the execution of the operator, the specific error script code location cannot
be located; when the value is set to True, the operator is executed synchronously on the device. It will
reduce the execution performance of the program. At this time, when an error occurs in the execution of
the operator, the location of the error script code can be located according to the call stack of the error.
Raises:
ValueError: If input key is not an attribute in context.