yobx.tensorflow.ops.element_wise#

Converters for element-wise TF ops: AddV2, BiasAdd, ConcatV2, SelectV2.

Addition / bias#

AddV2, BiasAdd

Concatenation#

ConcatV2

Conditional selection#

SelectV2

yobx.tensorflow.ops.element_wise.convert_concat_v2(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: Operation) str[source]#

Converts TF ConcatV2 → ONNX Concat.

TF ConcatV2 takes N tensor inputs followed by a scalar axis constant as the last input. The axis value is read from that constant and forwarded as the axis attribute of the ONNX Concat node.

yobx.tensorflow.ops.element_wise.convert_element_wise(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: Operation) str[source]#

Converts TF element-wise addition ops (AddV2, BiasAdd) to ONNX Add.

TF’s BiasAdd is semantically equivalent to adding a 1-D bias along the last dimension of the input, which maps directly to ONNX Add with numpy-style broadcasting.

yobx.tensorflow.ops.element_wise.convert_select_v2(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: Operation) str[source]#

Converts TF SelectV2 (tf.where(condition, x, y)) → ONNX Where.

SelectV2 selects elements from x where condition is True and from y otherwise. Broadcasting semantics match ONNX Where.