ScatterElementsV2Operation

Applicable Products

Hardware Model

Supported or Not

Atlas 350 accelerator card

x

Atlas A3 inference products/Atlas A3 training products

Atlas A2 training products/Atlas A2 inference products

Atlas training products

x

Atlas inference products

x

Atlas 200I/500 A2 inference products

x

Description

Writes all values in the tensor update to the tensor input based on the indices position.

Definition

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};
};

Parameters

Member

Type

Default Value

Value Range

Mandatory or Not

Description

axis

int32_t

-1

-1

No

Used in performing an update or accumulation along the specified axis. Currently, only the value -1 is supported.

reduction

int32_t

0

0,1

No

Whether to perform in-place update or in-place accumulation.

  • 0: in-place update.
  • 1: in-place accumulation.

rsv[24]

[uint8_t]

{0}

[0]

No

Reserved

Input

Parameter

Dimension

Data Type

Format

Description

input

[x_0, x_1, ..., x_n]

float16/float/uint8/int8/int32/bfloat16

ND

Original input tensor, to which the final result is written in place.

indice

[y_0, y_1, ..., y_n]

int64/int32

ND

Index. The shape of the non-tail axis and non-axis 0 must be the same as that of input.

Axis 0 and the tail axis cannot be greater than those of input.

The value range of the corresponding dimension dim in indice and input must be [0, corresponding dimension dim in input - 1]. For example, if the shape of input is [3, 3, 3], the value range of indice is [0, 2].

update

[y_0, y_1, ..., y_n]

Same as input

ND

Tensor to be updated or accumulated to the original input tensor.

Output

Parameter

Dimension

Data Type

Format

Description

input

[dim_0, dim_1,...,dim_n]

float16/float/uint8/int8/int32/bfloat16

ND

Original input tensor, to which the final result is written in place.