Thanks for sending an issue! Please fill in the following template to help quickly solve your problem.
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
功能说明 算子功能: 将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
缺少索引为2维的功能说明 示例代码路径不对导致无法跳转
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维的功能说明
示例代码路径不对导致无法跳转