yobx.litert.ops.reshape_ops#

Converters for TFLite shape / tensor-manipulation ops: RESHAPE, SQUEEZE, EXPAND_DIMS, TRANSPOSE, CONCATENATION, MEAN, SUM, REDUCE_MAX, REDUCE_MIN.

yobx.litert.ops.reshape_ops.convert_concatenation(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite CONCATENATION → ONNX Concat.

yobx.litert.ops.reshape_ops.convert_expand_dims(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite EXPAND_DIMS → ONNX Unsqueeze.

The axis index comes from tensor input 1.

yobx.litert.ops.reshape_ops.convert_mean(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite MEAN → ONNX ReduceMean.

yobx.litert.ops.reshape_ops.convert_reduce_max(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite REDUCE_MAX → ONNX ReduceMax.

yobx.litert.ops.reshape_ops.convert_reduce_min(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite REDUCE_MIN → ONNX ReduceMin.

yobx.litert.ops.reshape_ops.convert_reshape(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite RESHAPE → ONNX Reshape.

The target shape comes from tensor input 1 (an int32 1-D tensor).

yobx.litert.ops.reshape_ops.convert_squeeze(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite SQUEEZE → ONNX Squeeze.

The axes to squeeze come from builtin_options["squeeze_dims"]; if absent, squeeze all size-1 dims.

yobx.litert.ops.reshape_ops.convert_sum(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite SUM → ONNX ReduceSum.

yobx.litert.ops.reshape_ops.convert_transpose(g: GraphBuilderExtendedProtocol, sts: Dict[str, Any], outputs: List[str], op: TFLiteOperator) str[source]#

TFLite TRANSPOSE → ONNX Transpose.

The permutation is stored as tensor input 1. We read it directly from the graph builder’s initializer map because ONNX Transpose requires the perm attribute (not a runtime input).