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

[Docathon][Update Doc No.22、24-26、30、32、34] remove the related files,update program.rst and program_en.rst #7085

Closed
wants to merge 2 commits into from

Conversation

Abosite
Copy link
Contributor

@Abosite Abosite commented Mar 6, 2025

remove the related files
update program.rst and program_en.rst

@DrRyanHuang@sunzhongkai588

Copy link

paddle-bot bot commented Mar 6, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7085.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

Comment on lines -9 to -33
IfElse
======

条件分支,允许对同一个 batch 的输入,根据给定的条件,分别选择 :code:`true_block` 或 :code:`false_block` 中的逻辑进行执行,执行完成之后再将两个分支的输出合并为同一个输出。通常,条件表达式可由 :ref:`cn_api_fluid_layers_less_than`, :ref:`cn_api_fluid_layers_equal` 等逻辑比较 API 产生。

请参考 :ref:`cn_api_fluid_layers_IfElse`

**注意:** 强烈建议您使用新的 OP :ref:`cn_api_fluid_layers_cond` 而不是 ``IfElse``。:ref:`cn_api_fluid_layers_cond` 的使用方式更简单,并且调用该 OP 所用的代码更少且功能与 ``IfElse`` 一样。

Switch
======

多分支选择结构,如同程序语言中常见的 :code:`switch-case` 声明, 其根据输入表达式的取值不同,选择不同的分支执行。具体来说,Fluid 所定义的 :code:`Switch` 控制流有如下特性:

* case 的条件是个 bool 类型的值,即在 Program 中是一个张量类型的 Variable;
* 依次检查逐个 case,选择第一个满足条件的 case 执行,完成执行后即退出所属的 block;
* 如果所有 case 均不满足条件,会选择默认的 case 进行执行。

请参考 :ref:`cn_api_fluid_layers_Switch`

**注意:** 强烈建议您使用新的 OP :ref:`cn_api_fluid_layers_case` 而不是 ``Switch``。 :ref:`cn_api_fluid_layers_case` 的使用方式更简单,并且调用该 OP 所用的代码更少且功能与 ``Switch`` 一样。

While
=====

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请问其他文件还需要再修改吗?哪些可以直接删除?

Copy link
Member

@DrRyanHuang DrRyanHuang Mar 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗨,同学好,我之前在 #7083 中说 control_flow.rstsparse_update.rst 部分被其他内容引用,所以需要先修改。

其他内容没有被引用,都是个孤立的文件,那么就可以直接删除了

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好的好的,感谢您的回复! 那我先重新提交删除其他文件的PR,然后再去修改control_flow.rst

@luotao1 luotao1 added the HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务 label Mar 6, 2025
@DrRyanHuang DrRyanHuang closed this Mar 6, 2025
@DrRyanHuang DrRyanHuang reopened this Mar 6, 2025
@Abosite Abosite closed this Mar 6, 2025
@Abosite Abosite deleted the remove branch March 6, 2025 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource Pro 进阶版快乐开源活动,更具挑战性的任务
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants