File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -27,13 +27,13 @@ gather
27
27
参数
28
28
::::::::::::
29
29
- **x ** (Tensor) - 输入 Tensor,秩 ``rank >= 1 ``,支持的数据类型包括 int32、int64、float32、float64 和 uint8 (CPU)、float16(GPU) 。
30
- - **index ** (Tensor) - 索引 Tensor,秩 ``rank = 1 ``,数据类型为 int32 或 int64。
30
+ - **index ** (Tensor) - 索引 Tensor,秩 ``rank = 0 `` 或者 ``rank = 1 ``,数据类型为 int32 或 int64。
31
31
- **axis ** (Tensor) - 指定 index 获取输入的维度,``axis `` 的类型可以是 int 或者 Tensor,当 ``axis `` 为 Tensor 的时候其数据类型为 int32 或者 int64。
32
32
- **name ** (str,可选) - 具体用法请参见 :ref: `api_guide_Name `,一般无需设置,默认值为 None。
33
33
34
34
返回
35
35
::::::::::::
36
- 和输入的秩相同的输出 Tensor。
36
+ Tensor,当 index 为一维 Tensor 时,返回和输入 Tensor 的形状相同的 Tensor。当 index 为零维 Tensor 时,返回 Tensor 相对于输入 Tensor 会降维, axis 指向的维度会被降维 。
37
37
38
38
39
39
代码示例
Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ scatter
37
37
参数
38
38
:::::::::
39
39
- **x ** (Tensor) - ndim> = 1 的输入 N-D 张量。数据类型可以是 float32,float64。
40
- - **index ** (Tensor)- 一维 Tensor。数据类型可以是 int32,int64。 ``index `` 的长度不能超过 ``updates `` 的长度,并且 ``index `` 中的值不能超过输入的长度。
41
- - **updates ** (Tensor)- 根据 ``index `` 使用 ``update `` 参数更新输入 ``x ``。形状应与输入 ``x `` 相同,并且 dim>1 的 dim 值应与输入 ``x `` 相同。
40
+ - **index ** (Tensor)- 一维或者零维 Tensor。数据类型可以是 int32,int64。 ``index `` 的长度不能超过 ``updates `` 的长度,并且 ``index `` 中的值不能超过输入的长度。
41
+ - **updates ** (Tensor)- 根据 ``index `` 使用 ``update `` 参数更新输入 ``x ``。当 `` index `` 为一维 tensor 时,`` updates `` 形状应与输入 ``x `` 相同,并且 dim>1 的 dim 值应与输入 ``x `` 相同。当 `` index `` 为零维 tensor 时,`` updates `` 应该是一个 (N-1)-D 的张量,并且 `` updates `` 的第 i 个维度应该与 `` x `` 的 i+1 个维度相同 。
42
42
- **overwrite ** (bool,可选)- 指定索引 ``index `` 相同时,更新输出的方式。如果为 True,则使用覆盖模式更新相同索引的输出,如果为 False,则使用累加模式更新相同索引的输出。默认值为 True。
43
43
- **name ** (str,可选) - 具体用法请参见 :ref: `api_guide_Name `,一般无需设置,默认值为 None。
44
44
You can’t perform that action at this time.
0 commit comments