Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in 4.3 #464

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ with tf.Session() as sess:
静态图和动态图除了在前端语言表达上略有差异,本质的区别在于编译执行过程。使用前端语言构建完成模型表达后,动态生成并不采用机器学习框架编译器生成完整的静态计算图,而是采用前端语言的解释器Python API调用机器学习框架,框架利用自身的算子分发功能,将Python调用的算子在相应的硬件如CPU、GPU、NPU等上进行加速计算,然后再将计算结果返回给前端。该过程并不产生静态的计算图,而是按照前端语言描述模型结构,按照计算依赖关系进行调度执行,动态生成临时的图拓扑结构。


如:numref:`dynamicgen`中所示动态生成流程。
:numref:`dynamicgen`中所示动态生成流程。

![动态生成](../img/ch03/eager-gen.png)
:width:`700px`
Expand All @@ -93,7 +93,7 @@ with tf.Session() as sess:

### 动态和静态生成的比较

静态生成和动态生成的过程各有利弊。为了方便读者对比,将静态图和动态图特性总结见 :numref:`cmp_dynamic_static`。
静态生成和动态生成的过程各有利弊。为了方便读者对比,将静态图和动态图特性总结见 :numref:`cmp_dynamic_static`。

:静态图和动态图对比

Expand All @@ -104,7 +104,7 @@ with tf.Session() as sess:
| 控制流实现方式 | 特定的语法 | 前端语言语法 |
| 性能 | 优化策略多,性能更佳 | 图优化受限,性能较差 |
| 内存占用 | 内存占用少 | 内存占用相对较多 |
| 内存占用 | 可直接部署 | 不可直接部署 |
| 是否可直接部署 | 可直接部署 | 不可直接部署 |
:label:`cmp_dynamic_static`


Expand Down