昇腾社区首页
中文
注册

ScatterElementsV2Operation

产品支持情况

硬件型号

是否支持

Atlas A3 推理系列产品/Atlas A3 训练系列产品

Atlas A2 训练系列产品/Atlas 800I A2 推理产品

Atlas 训练系列产品

x

Atlas 推理系列产品

x

Atlas 200I/500 A2 推理产品

x

功能说明

将张量update中的所有的值,按照indices位置,写到自身张量input中。

定义

1
2
3
4
5
6
7
8
9
struct ScatterElementsV2Param {
    enum ReductionType {
        NONE = 0,
        ADD, 
    };
    int32_t axis = -1;
    ReductionType reduction = NONE;
    uint8_t rsv[24] = {0};
};

参数列表

成员名称

类型

默认值

取值范围

是否必选

描述

axis

int32_t

-1

-1

按照指定轴进行更新或者累加,目前只支持取值为 -1。

reduction

int32_t

0

0,1

指定是原地更新还是原地累加。

  • 0:原地更新。
  • 1:原地累加。

rsv[24]

[uint8_t]

{0}

[0]

预留参数。

输入

参数

维度

数据类型

格式

描述

input

[x_0,x_1,...,x_n]

float16/float/uint8/int8/int32/bfloat16

ND

原始输入张量,最终结果原地写入此张量。

indice

[y_0,y_1,...,y_n]

int64/int32

ND

索引。在非尾轴和非0轴上的shape必须和input一致 。

0轴和尾轴不大于input的0轴和尾轴。

update

[y_0,y_1,...,y_n]

同input

ND

待更新或累加到原始输入张量中的张量。

输出

参数

维度

数据类型

格式

描述

input

[dim_0,dim_1,...,dim_n]

float16/float/uint8/int8/int32/bfloat16

ND

原始输入张量,最终结果原地写入此张量。