From ad1b8df57a21ce0f8dd6443d8e5e49b00fdeb2d7 Mon Sep 17 00:00:00 2001 From: Deeptanshu Sekhri Date: Fri, 18 Jul 2025 13:00:47 +0100 Subject: [PATCH 1/2] fix(pybind11): reorder parameters in _tflite_flatbuffer_to_tosa_mlir binding Signed-off-by: Deeptanshu Sekhri --- .../tosa_converter_for_tflite_pybind11.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc b/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc index 1f40c34..9adcccd 100644 --- a/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc +++ b/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc @@ -116,10 +116,9 @@ PYBIND11_MODULE(_tosa_converter_for_tflite_wrapper, m) { m.def( "_tflite_flatbuffer_to_tosa_mlir", [](const std::string& tflite_input_file, pybind11::object tosa_sink, + tosa_converter_for_tflite::TosaConverterOutputFormat output_format, const std::unordered_map>& - override_tflite_input_shape, - tosa_converter_for_tflite::TosaConverterOutputFormat output_format = - tosa_converter_for_tflite::TosaConverterOutputFormat::Bytecode) { + override_tflite_input_shape) { DispatchTFLiteToTosaConversion(tflite_input_file, tosa_sink, output_format, override_tflite_input_shape); @@ -134,9 +133,9 @@ PYBIND11_MODULE(_tosa_converter_for_tflite_wrapper, m) { Args: tflite_input_file (str): Path to the input TFLite file. tosa_sink (str or BinaryIO): Path to output tosa file, or a writable binary stream (e.g., BytesIO). + override_shapes (dict): Mapping of input tensor names to their overridden shape. output_format (TosaConverterOutputFormat, optional): - TosaConverterOutputFormat.Bytecode: emit MLIR bytecode (default) - TosaConverterOutputFormat.Text: emit human-readable MLIR text - override_shapes (dict): Mapping of input tensor names to their overridden shape. )doc"); } -- GitLab From 014f0afc0701777de789d440f35e3229756465ec Mon Sep 17 00:00:00 2001 From: Deeptanshu Sekhri Date: Fri, 18 Jul 2025 13:57:25 +0100 Subject: [PATCH 2/2] fix: docstring parameter order and name Signed-off-by: Deeptanshu Sekhri --- tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc b/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc index 9adcccd..22399b5 100644 --- a/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc +++ b/tosa_converter_for_tflite/tosa_converter_for_tflite_pybind11.cc @@ -133,9 +133,9 @@ PYBIND11_MODULE(_tosa_converter_for_tflite_wrapper, m) { Args: tflite_input_file (str): Path to the input TFLite file. tosa_sink (str or BinaryIO): Path to output tosa file, or a writable binary stream (e.g., BytesIO). - override_shapes (dict): Mapping of input tensor names to their overridden shape. output_format (TosaConverterOutputFormat, optional): - TosaConverterOutputFormat.Bytecode: emit MLIR bytecode (default) - TosaConverterOutputFormat.Text: emit human-readable MLIR text + override_tflite_input_shape (dict): Mapping of input tensor names to their overridden shape. )doc"); } -- GitLab