-
Notifications
You must be signed in to change notification settings - Fork 765
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
[SCU][Add API Legend No.21] Add the legend of scatter_nd_add_cn #6964
Conversation
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6964.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
英文文档是直接从 源码 里抽取docstring再自动转成rst的,不用手写,这块儿全删了吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的,我将英文文档删除
@@ -57,4 +57,13 @@ Tensor,数据类型和形状都与 :code:`x` 相同。 | |||
代码示例 | |||
:::::::::::: | |||
|
|||
COPY-FROM: paddle.scatter_nd_add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为什么把这块儿删了? 这部分是引用源码里的代码示例
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经添加上去了
@@ -57,4 +57,13 @@ Tensor,数据类型和形状都与 :code:`x` 相同。 | |||
代码示例 | |||
:::::::::::: | |||
|
|||
COPY-FROM: paddle.scatter_nd_add | |||
|
|||
output = [0, 22, 12, 14, 4, 5] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这部分是笔误了多加了么
**示例一图解说明**: | ||
|
||
在这个示例中,通过 Paddle 的 scatter_nd_add 函数对张量 x 进行稀疏加法操作。初始张量 x 为 [0, 1, 2, 3, 4, 5],通过 index 指定需要更新的索引位置,并使用 updates 中的值进行累加。scatter_nd_add 函数会根据 index 的位置逐步累加 updates 中的对应值,而不是替换原有值,最终得到输出张量为 [0, 22, 12, 14, 4, 5],实现了对张量部分元素的累加更新而保持其他元素不变。 | ||
.. figure:: ../../images/api_legend/scatter_nd_add.png | ||
:width: 700 | ||
:alt: 示例一图示 | ||
:align: center |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
图解部分放在 参数 板块上面,即api简介的那部分。 而不是替换原有值
有些多余,可以删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
红色虚线框似乎会增加图片的理解难度,可以删掉。 +9 可以放在方向键的左侧保持统一
@@ -41,6 +41,9 @@ scatter_nd_add | |||
|
|||
output = [[67, 19], [-16, -27]] | |||
|
|||
**示例一图解说明**: | |||
|
|||
在这个示例中,通过 Paddle 的 scatter_nd_add 函数对张量 x 进行稀疏加法操作。初始张量 x 为 [0, 1, 2, 3, 4, 5],通过 index 指定需要更新的索引位置,并使用 updates 中的值进行累加。scatter_nd_add 函数会根据 index 的位置逐步累加 updates 中的对应值,最终得到输出张量为 [0, 22, 12, 14, 4, 5],实现了对张量部分元素的累加更新而保持其他元素不变。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
图例的引用也放在文字说明下面呀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
修改了引用的位置
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
文件名少了个d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已经修改
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM~
No description provided.