Skip to content

Conversation

zhanghonggeng
Copy link

@zhanghonggeng zhanghonggeng commented Aug 19, 2025

  1. Add paddle.nn.functional.dropout1d docs. PR: add paddle nn.functional.dropout1d api
  2. Add paddle.nn.parameter.Parameter docs. PR:[API compatibility] add paddle.nn.parameter.Parameter
  3. Update paddle.add、paddle.add_ docs. PR:[API compatibility] update paddle add api
  4. Update paddle.divide、paddle.divide_、paddle.add、paddle.div、paddle.div_、paddle.true_divide docs. PR:[API compatibility] update paddle divide divide_ add div div_ true_divide API

Copy link

paddle-bot bot commented Aug 19, 2025

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

@SigureMo
Copy link
Member

文档就麻烦 @sunzhongkai588 把关下吧

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

Comment on lines 23 to 36
.. code-block:: python
import paddle
# Case 1: 3D input (batched)
x = paddle.randn([2, 3, 10]) # [N, C, L]
y_train = paddle.nn.functional.dropout1d(x, p=0.2)
y_test = paddle.nn.functional.dropout1d(x, p=0.2, training=False)
print("Original first channel:", x[0, 0, :])
print("Train output (may be zeroed):", y_train[0, 0, :])
print("Test output (always unchanged):", y_test[0, 0, :])
# Case 2: 2D input (single sample)
x = paddle.randn([3, 8]) # [C, L]
y = paddle.nn.functional.dropout1d(x, p=0.5)
print("Input shape:", x.shape)
print("Output shape:", y.shape)
Copy link
Collaborator

Choose a reason for hiding this comment

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

代码示例用 copy-from 的形式引用英文的代码示例,保持统一

Copy link
Author

Choose a reason for hiding this comment

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

已修改

Comment on lines 19 to 24
.. code-block:: python
import paddle
weight = paddle.nn.parameter.Parameter(
data=paddle.randn([10, 10]),
requires_grad=True
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

代码部分用 copy-from 引用

Copy link
Author

Choose a reason for hiding this comment

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

已修改

Co-authored-by: zachary sun <70642955+sunzhongkai588@users.noreply.github.com>
Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants