OnehotOperation

功能

onehot编码。

定义

struct OnehotParam {
    int64_t axis = 0;
    int64_t depth = 0;
};

成员

成员名称

描述

axis

depth所在下标。可为负数。

depth

类别数。

输入

参数

维度

数据类型

格式

描述

input

[-1,…,-1]

int32/int64

ND

原tensor,维度数不超过7。

one

[1]

int32/int64

ND

标量0。

zero

[1]

int32/int64

ND

标量1。

输出

参数

维度

数据类型

格式

描述

output

[-1,…,-1]

int32/int64

ND

输出tensor,维度数为input的维度数+1。