@@ -26,6 +26,8 @@ By default, MindSpore is in PyNative mode. You can switch it to the graph mode b
In PyNative mode, single operators, common functions, network inference, and separated gradient calculation can be executed. The following describes the usage and precautions.
> In PyNative mode, operators are executed asynchronously on the device to improve performance. Therefore, when an error occurs during operator excution, the error information may be displayed after the program is executed.
## Executing a Single Operator
Execute a single operator and output the result, as shown in the following example.
...
...
@@ -243,6 +245,7 @@ print(z.asnumpy())
[ 0.0377498 -0.06117418 0.00546303]]]]
```
## Debugging Network Train Model
In PyNative mode, the gradient can be calculated separately. As shown in the following example, `GradOperation` is used to calculate all input gradients of the function or the network. Note that the inputs have to be Tensor.