TransposeOperation
功能
改变输入Tensor的排列顺序,在多个维度上进行转置。
图1 TransposeOperation


定义
struct TransposeParam { SVector<int32_t> perm; };
参数列表
成员名称 |
类型 |
默认值 |
描述 |
---|---|---|---|
perm |
SVector< int32_t > |
- |
指示输入维度的重排结果。 例如:输入tensor的shape是[a,b,c],perm是[0,2,1],表明交换第一维和第二维,输出tensor的shape是[a,c,b]。 perm需要保证输入正确,维度和输入x一致。 |
输入
参数 |
维度 |
数据类型 |
格式 |
---|---|---|---|
x |
[dim_0,dim_1,... ,dim_n] |
float16/bf16/int64 |
ND |
输出
参数 |
维度 |
数据类型 |
格式 |
---|---|---|---|
output |
维度由参数确定 |
float16/bf16/int64 数据类型与x保持一致 |
ND |