Operator KernelRemap

Operator Library: Base

KernelRemap 算子允许在输入和输出之间对卷积核组件进行重新映射。 该算子的输出与输入具有相同的卷积核维度。 通过使用静态参数 SourceSelect,可以重新映射卷积核组件。 这可用于镜像卷积核,或者对卷积核组件进行旋转。

重新映射是通过为每个输出分配一个新的输入卷积核索引来实现的。 因此,对于每个输出卷积核组件,都会使用 SourceSelect 参数选择一个输入卷积核组件。 也可以将同一个输入卷积核组件分配给多个输出卷积核组件。 如果某个输入卷积核组件未映射到任何输出,则该数据将被丢弃。

I/O Property

Property 值
Operator Type O
Input Link I,数据输入
Output Link O,数据输出

Supported Link Format

Link Parameter Input Link I Output Link O
Bit Width [1, 64]1 as I
Arithmetic {unsigned, signed} as I
Parallelism any as I
Kernel Columns any as I
Kernel Rows any as I
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D} as I
Color Format any as I
Color Flavor any as I
Max. Img Width any as I
Max. Img Height any as I

1

输入 Bit Width 的范围是 [1, 64]。对于有符号输入,范围是 [2, 64]。对于无符号彩色输入,范围是 [3, 63],对于有符号彩色输入,范围是 [6, 63]。

参数

SourceSelect
键入 static 参数
默认 index
范围 [0, KernelRows * KernelCols - 1]

此参数定义了卷积核的重新映射。 它表示输出卷积核组件。 因此,会为每个输出卷积核组件选择一个输入卷积核组件。

卷积核组件的索引顺序为从左上角到右下角。

使用示例

以下示例展示了 KernelRemap 算子的使用方法: