提交 559675c6 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!55 fix error words in dynamic debugging module

Merge pull request !55 from wangqiuliang/fix-error-words-in-dynamic-debugging
......@@ -143,7 +143,7 @@ print(res.asnumpy())
[3. 3. 3. 3.]]
```
In the preceding code, the `ms_function` decorator is added before `construct` of the `TensorAddNet` class. The decorator compiles the `construct` method into a computational graph. After the input is given, the graph is delivered and executed, `F.tensor_add` in the preceding code is executed in the common PyNative mode.
In the preceding code, the `ms_function` decorator is added before `construct` of the `TensorAddNet` class. The decorator compiles the `construct` method into a computational graph. After the input is given, the graph is delivered and executed, `tensor_add` in the preceding code is executed in the common PyNative mode.
It should be noted that, in a function to which the `ms_function` decorator is added, if an operator (such as `pooling` or `tensor_add`) that does not need parameter training is included, the operator can be directly called in the decorated function, as shown in the following example:
......
......@@ -143,7 +143,7 @@ print(res.asnumpy())
[3. 3. 3. 3.]]
```
上述示例代码中,在`TensorAddNet`类的`construct`之前加装了`ms_function`装饰器,该装饰器会将`construct`方法编译成计算图,在给定输入之后,以图的形式下发执行,而上一示例代码中的`F.tensor_add`会直以普通的PyNative的方式执行。
上述示例代码中,在`TensorAddNet`类的`construct`之前加装了`ms_function`装饰器,该装饰器会将`construct`方法编译成计算图,在给定输入之后,以图的形式下发执行,而上一示例代码中的`tensor_add`会直接以普通的PyNative的方式执行。
需要说明的是,加装了`ms_function`装饰器的函数中,如果包含不需要进行参数训练的算子(如`pooling``tensor_add`等算子),则这些算子可以在被装饰的函数中直接调用,如下例所示。
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册