已关闭
[Documentation|文档反馈]: scatter算子功能描述与代码不匹配,少一种场景,另外样例代码无法跳转 #5483
zhang-wenbo-beat创建于  29 天前关闭于  29 天前
zhang-wenbo-beat
zhang-wenbo-beat成员
29 天前 创建

Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.

Document Link(文档链接)

https://gitcode.com/cann/ops-nn/blob/master/index/scatter/docs/aclnnInplaceScatterUpdate.md
https://gitcode.com/cann/ops-nn/blob/master/index/scatter/README.md

Issues Section(问题文档片段)

功能说明
算子功能: 将tensor updates中的值按指定的轴axis和索引indices逐个更新tensor data中的值。

示例: 该算子有3个输入和一个属性:data,updates,indices和axis,其中data是待更新的tensor,updates是存储更新数据的tensor,indices表示更新位置, axis是指定的更新维度。当indices为1维,存在以下两种场景:

场景一: indices为1维,axis指定更新的维度shape为1,indices指定的是每个batch维度(最高维)在axis维度的偏移。

样例输入:
data:(a, b, c, d)
updates:(a, b, 1, d)
indices:(a,)
axis = -2

data[i][j][indices[i]][k] = updates[i][j][0][k] # if dim=-2
data[i][j][k][indices[i]] = updates[i][j][k][0] # if dim=-1

场景二: indices为1维,axis指定更新的维度shape大于1,indices指定的是每个batch维度(最高维)在axis维度的偏移。

样例输入:
data:(a, b, c, d)
updates:(a, b, e, d), indices[i] + e <= c
indices:(a,)
axis = -2 or 2

data[i][j][indices[i]+k][l] = updates[i][j][k][l] # if dim=-2
data[i][j][k][indices[i]+l] = updates[i][j][k][l] # if dim=-1

Existing Issues(存在的问题)

缺少索引为2维的功能说明
示例代码路径不对导致无法跳转

likedislike
zhang-wenbo-beatzhang-wenbo-beat成员
29 天前 添加了label:documentation
zhang-wenbo-beatzhang-wenbo-beat成员
29 天前 将 zhang-wenbo-beat 设为负责人
CANN-robotCANN-robot成员
29 天前 关闭了 issue
zhang-wenbo-beatzhang-wenbo-beat成员
29 天前 issue状态由 进行中 改变为 已完成
CANN-robotCANN-robot成员
28 天前 添加了label:resolved