Operator IF

Operator Library: Logic

IF 算子会检查条件输入是否为 true,并转发相应的数据输入值。 该算子配备了可配置数量的输入链接 I0..In-1。 每个输入链接都附带一个条件输入 Condition。 如果某个条件为 true,则其对应输入的数据会被转发到输出。 如果所有条件输入都为 false,则使用 Else 输入。 如果有多个条件输入为 true,则所有相应的输入链接都会被转发到输出,并通过逻辑 OR 运算进行组合。 该算子可与内核一起使用。每个内核组件均可独立选择。

I/O Property

Property 值
Operator Type O
输入链路 I0,数据输入
I1..In-1,数据输入
Else,数据输入
Condition0..n-1,数据输入
Output Link O,数据输出

Supported Link Format

Link Parameter 输入链接 I0 输入链接 I1..In-1 输入链接 Else 输入链接 Condition0..n-1 Output Link O
Bit Width [1, 64]1 作为 I0 作为 I0 1 作为 I0
Arithmetic {unsigned, signed} 作为 I0 作为 I0 unsigned 作为 I0
Parallelism any 作为 I0 作为 I0 作为 I0 作为 I0
Kernel Columns any 作为 I0 作为 I0 作为 I0 作为 I0
Kernel Rows any 作为 I0 作为 I0 作为 I0 作为 I0
Img Protocol {VALT_IMAGE2D, VALT_LINE1D, VALT_PIXEL0D, VALT_SIGNAL} 作为 I0 作为 I0 作为 I0 作为 I0
Color Format any 作为 I0 作为 I0 VAF_GRAY 作为 I0
Color Flavor any 作为 I0 作为 I0 FL_NONE 作为 I0
Max. Img Width any 作为 I0 作为 I0 作为 I0 作为 I0
Max. Img Height any 作为 I0 作为 I0 作为 I0 作为 I0

1

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

参数

无

使用示例

以下示例展示了 IF 算子的用法: