GatherOperation

功能

从inTensor中根据索引抽取指定的数据。

图1 GatherOperation

约束

索引表,即indices的元素大小须小于指定轴(维度)的大小,x与indices的维度之和小于等于9。

定义

struct GatherParam {
    int64_t axis = 0;
    int64_t batchDims = 0;
};

成员

成员名称

描述

axis

在指定的axis轴(维度)上根据索引抽取指定元素。

“axis”大于或等于0且小于输入x的维度。

batchDims

在指定的batchDims维度进行gather。

输入

参数

维度

数据类型

格式

描述

x

[-1,…,-1]

-1表示当前维度的大小没有约束。

float16/float/bfloat16/int32/uint32

ND

-

indices

[-1,…,-1]

-1表示当前维度的大小没有约束。

int64/int32/uint32

ND

索引表

输出

参数

维度

数据类型

格式

output

[-1,…,-1]

-1表示当前维度的大小没有约束。

float16/float/bfloat16/int32/uint32

ND