Skip to content

Commit

Permalink
fix format bugs. (#5218)
Browse files Browse the repository at this point in the history
* rm unnecessary pronouns

* Update basic_usage_cn.md

* rm Macos GPU docker

* Update macos-docker_en.md

* Update macos-docker.md

* rm unnecessary pronouns

* Update grammar_list_cn.md

* fix format

* Update case_analysis_cn.md

* add GPU architecture comparison table link

* Update windows-pip.md

* Update windows-pip_en.md

* Update linux-pip.md

* Update linux-pip_en.md

* fix format docs

* fix url lose
  • Loading branch information
gouzil authored Sep 1, 2022
1 parent 0262a90 commit 517bf0c
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 29 deletions.
4 changes: 2 additions & 2 deletions docs/guides/jit/basic_usage_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ paddle.jit.save(loaded_layer, "fine-tune.model/linear", input_spec=[x])

##### 3.2.2.2 使用 ``paddle.load`` 加载

``paddle.jit.save`` 同时保存了模型和参数,如果你已有组网代码,只需要从存储结果中载入模型的参数,则可以使用 ``paddle.load`` 接口载入,返回所存储模型的 ``state_dict`` ,并使用 ``set_state_dict`` 方法将模型参数与 Layer 关联。示例如下:
``paddle.jit.save`` 同时保存了模型和参数,如果已有组网代码,只需要从存储结果中载入模型的参数,则可以使用 ``paddle.load`` 接口载入,返回所存储模型的 ``state_dict`` ,并使用 ``set_state_dict`` 方法将模型参数与 Layer 关联。示例如下:

```python
import paddle
Expand Down Expand Up @@ -625,7 +625,7 @@ pred = loaded_layer(x)
return self._linear(x)
```

4. 前文中大多都是用 ``paddle.jit.save`` 保存的 ``Layer.forward`` 类实例,保存内容包括模型结构和参数。当保存单独的一个函数时, ``paddle.jit.save`` 只会保存这个函数对应的静态图模型结构 Program ,不会保存和这个函数相关的参数。如果你必须保存参数,请使用 Layer 类封装这个函数。 示例代码如下:
4. 前文中大多都是用 ``paddle.jit.save`` 保存的 ``Layer.forward`` 类实例,保存内容包括模型结构和参数。当保存单独的一个函数时, ``paddle.jit.save`` 只会保存这个函数对应的静态图模型结构 Program ,不会保存和这个函数相关的参数。如果必须保存参数,请使用 Layer 类封装这个函数。 示例代码如下:

```python
# 定义一个函数
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/jit/case_analysis_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class SimpleNet(object): # <---- 继承 Object

同时,所有继承 ``nn.Layer````sublayer`` 都建议:

+ 重写 ``forward`` 函数,尽量避免重写 ``__call__``` 函数
+ 重写 ``forward`` 函数,尽量避免重写 ``__call__`` 函数
> ``__call__`` 函数通常会包含框架层面的一些通用的处理逻辑,比如 ``pre_hook````post_hook`` 。重写此函数可能会覆盖框架层面的逻辑。

+ 尽量将 ``forward`` 函数作为 sublayers 的调用入口
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/jit/grammar_list_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
3. 当出现不支持的语法时,如何修改源码适配动转静语法


若你初次接触动转静功能,或对此功能尚不熟悉,推荐阅读:[使用样例](./basic_usage_cn.html)
若初次接触动转静功能,或对此功能尚不熟悉,推荐阅读:[使用样例](./basic_usage_cn.html)

若你动静转换遇到了问题,或想学习调试的技巧,推荐阅读:[报错调试](./debugging_cn.html)
若动静转换遇到了问题,或想学习调试的技巧,推荐阅读:[报错调试](./debugging_cn.html)

## 二、语法支持速查列表

Expand Down
8 changes: 0 additions & 8 deletions docs/install/docker/macos-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-jupyter </td>
<td> 安装了 2.1.0 版本 paddle 的 CPU 镜像,且镜像中预装好了 jupyter,启动 docker 即运行 jupyter 服务 </td>
</tr>
<tr>
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-gpu-cuda11.2-cudnn8 </td>
<td> 安装了 2.1.0 版本 paddle 的 GPU 镜像,cuda 版本为 11.2,cudnn 版本为 8.1 </td>
</tr>
<tr>
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-gpu-cuda10.2-cudnn7 </td>
<td> 安装了 2.1.0 版本 paddle 的 GPU 镜像,cuda 版本为 10.2,cudnn 版本为 7 </td>
</tr>
</tbody>
</table>
</p>
Expand Down
8 changes: 0 additions & 8 deletions docs/install/docker/macos-docker_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ Now you have successfully used Docker to install PaddlePaddle. For more informat
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-jupyter </td>
<td> CPU image of paddle version 2.1.0 is installed, and jupyter is pre-installed in the image. Start the docker to run the jupyter service </td>
</tr>
<tr>
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-gpu-cuda11.2-cudnn8 </td>
<td> GPU image of paddle version 2.1.0 is installed, cuda version is 11.2, cudnn version is 8.1 </td>
</tr>
<tr>
<td> registry.baidubce.com/paddlepaddle/paddle:2.1.0-gpu-cuda10.2-cudnn7 </td>
<td> GPU image of paddle version 2.1.0 is installed, cuda version is 10.2, cudnn version is 7 </td>
</tr>
</tbody>
</table>
</p>
Expand Down
4 changes: 2 additions & 2 deletions docs/install/pip/linux-pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

* 默认提供的安装包需要计算机支持 MKL

* 如果您对机器环境不了解,请下载使用[快速安装脚本](https://fast-install.bj.bcebos.com/fast_install.sh),配套说明请参考[这里](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/install/install_script.md)
* 如果您对机器环境不了解,请下载使用[快速安装脚本](https://fast-install.bj.bcebos.com/fast_install.sh),配套说明请参考[这里](https://github.com/PaddlePaddle/docs/blob/develop/docs/install/install_script.md)



Expand Down Expand Up @@ -171,7 +171,7 @@

注:

* 如果你使用的是安培架构的 GPU,推荐使用 CUDA11.2。如果你使用的是非安培架构的 GPU,推荐使用 CUDA10.2,性能更优。
* 如果你使用的是安培架构的 GPU,推荐使用 CUDA11.2。如果你使用的是非安培架构的 GPU,推荐使用 CUDA10.2,性能更优。请参考: [GPU 架构对照表](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#nvidia-gpu)

* 请确认需要安装 PaddlePaddle 的 Python 是您预期的位置,因为您计算机可能有多个 Python。根据您的环境您可能需要将说明中所有命令行中的 python 替换为 python3 或者替换为具体的 Python 路径。

Expand Down
4 changes: 2 additions & 2 deletions docs/install/pip/linux-pip_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

* The installation package provided by default requires computer support for MKL

* If you do not know the machine environment, please download and use[Quick install script](https://fast-install.bj.bcebos.com/fast_install.sh), for instructions please refer to[here](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/install/install_script.md)
* If you do not know the machine environment, please download and use[Quick install script](https://fast-install.bj.bcebos.com/fast_install.sh), for instructions please refer to[here](https://github.com/PaddlePaddle/docs/blob/develop/docs/install/install_script.md)



Expand Down Expand Up @@ -182,7 +182,7 @@ You can choose the following version of PaddlePaddle to start installation:

Note:

* If you are using ampere-based GPU, CUDA 11.2 is recommended; otherwise CUDA 10.2 is recommended for better performance.
* If you are using ampere-based GPU, CUDA 11.2 is recommended; otherwise CUDA 10.2 is recommended for better performance. please refer to: [GPU architecture comparison table](https://www.paddlepaddle.org.cn/documentation/docs/en/install/Tables.html#nvidia-gpu)

* Please confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python. Depending on the environment, you may need to replace Python in all command lines in the instructions with Python 3 or specific Python path.

Expand Down
2 changes: 1 addition & 1 deletion docs/install/pip/macos-pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

* 默认提供的安装包需要计算机支持 MKL

* 如果您对机器环境不了解,请下载使用[快速安装脚本](https://fast-install.bj.bcebos.com/fast_install.sh),配套说明请参考[这里](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/install/install_script.md)
* 如果您对机器环境不了解,请下载使用[快速安装脚本](https://fast-install.bj.bcebos.com/fast_install.sh),配套说明请参考[这里](https://github.com/PaddlePaddle/docs/blob/develop/docs/install/install_script.md)



Expand Down
2 changes: 1 addition & 1 deletion docs/install/pip/macos-pip_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

* The installation package provided by default requires computer support for MKL

* If you do not know the machine environment, please download and use[Quick install script](https://fast-install.bj.bcebos.com/fast_install.sh), for instructions please refer to[here](https://github.com/PaddlePaddle/FluidDoc/tree/develop/doc/fluid/install/install_script.md)
* If you do not know the machine environment, please download and use[Quick install script](https://fast-install.bj.bcebos.com/fast_install.sh), for instructions please refer to[here](https://github.com/PaddlePaddle/docs/blob/develop/docs/install/install_script.md)



Expand Down
2 changes: 1 addition & 1 deletion docs/install/pip/windows-pip.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

注:

* 如果你使用的是安培架构的 GPU,推荐使用 CUDA11.2。如果你使用的是非安培架构的 GPU,推荐使用 CUDA10.2,性能更优。
* 如果你使用的是安培架构的 GPU,推荐使用 CUDA11.2。如果你使用的是非安培架构的 GPU,推荐使用 CUDA10.2,性能更优。请参考: [GPU 架构对照表](https://www.paddlepaddle.org.cn/documentation/docs/zh/install/Tables.html#nvidia-gpu)

* 请确认需要安装 PaddlePaddle 的 Python 是您预期的位置,因为您计算机可能有多个 Python。根据您的环境,可能需要将上述命令行中所有 `python` 替换为具体的 `Python 解释器` 路径(例如 C:\Python37\python.exe)。

Expand Down
2 changes: 1 addition & 1 deletion docs/install/pip/windows-pip_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ You can choose the following version of PaddlePaddle to start installation:

Note:

* If you are using ampere-based GPU, CUDA 11.2 is recommended; otherwise CUDA 10.2 is recommended for better performance.
* If you are using ampere-based GPU, CUDA 11.2 is recommended; otherwise CUDA 10.2 is recommended for better performance. please refer to: [GPU architecture comparison table](https://www.paddlepaddle.org.cn/documentation/docs/en/install/Tables.html#nvidia-gpu)

* Please confirm that the Python where you need to install PaddlePaddle is your expected location, because your computer may have multiple Python. Depending on the environment, you may need to replace Python in all command lines in the instructions with specific Python path.

Expand Down

0 comments on commit 517bf0c

Please sign in to comment.