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][Add API Legend No.24] #6837

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions docs/api/paddle/slice_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ slice
则:
result=[[2,3,4],] # 即 data[0:1, 1:4]

下图展示了示例 1 中的情形——一个形状为[2, 4]的二维张量通过切片操作转变为形状为[1, 3]的二维张量。切片操作指定了在第 0 轴和第 1 轴上的起始和结束索引,可以清晰地看到切片操作前后张量中各元素的对应关系。

.. image:: ../../images/api_legend/slice.png
:width: 500
:alt: 图例


参数
::::::::::::

Expand Down
6 changes: 6 additions & 0 deletions docs/api/paddle/slice_scatter_cn.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ slice_scatter

沿着 `axes` 将 `value` 矩阵的值嵌入到 `x` 矩阵。返回一个新的 Tensor 而不是视图。 `axes` 需要与 `starts`, `ends` 和 `strides` 尺寸一致。

下图展示了代码示例三的情形——一个形状为 [3, 3, 5] 的三维张量 x,在 Axis 0 和 Axis 2 上使用 slice scatter 操作,将形状为 [1, 3, 1] 的 value 张量嵌入到指定的范围内。图中显示了原始张量、value 张量以及操作后的结果,并标注了每个轴的坐标,便于观察操作前后的元素分布情况。

.. image:: ../../images/api_legend/slice_scatter.png
:width: 500
:alt: 图例

参数
:::::::::
- **x** (Tensor) - 输入的 Tensor 作为目标矩阵,数据类型为: `bool`、 `float16`、 `float32`、 `float64`、 `uint8`、 `int8`、 `int16`、 `int32`、 `int64`、 `bfloat16`、 `complex64`、 `complex128`。
Expand Down
Binary file added docs/images/api_legend/slice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/api_legend/slice_scatter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.