From b207a7cc8eda9850efa9ce7d719900a2faf9a7d4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Shubham=20Gupta/SNAP=20/SRI-Bangalore/Engineer/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Thu, 6 Dec 2018 06:27:23 +0530 Subject: [PATCH] [tfltool] Enable select operator for transpose op (#3811) This patch will enable transpose op in tflitetool in select_operator.py Signed-off-by: shubham --- tools/tflitefile_tool/select_operator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/tflitefile_tool/select_operator.py b/tools/tflitefile_tool/select_operator.py index 0100b64..b615695 100644 --- a/tools/tflitefile_tool/select_operator.py +++ b/tools/tflitefile_tool/select_operator.py @@ -501,7 +501,15 @@ def GenerateBuiltinOption(new_builder, selected_builtin_option, builtin_option_t tflite.SpaceToBatchNDOptions.SpaceToBatchNDOptionsStart(new_builder) return tflite.SpaceToBatchNDOptions.SpaceToBatchNDOptionsEnd(new_builder) - # TransposeOptions: not supported + # TransposeOptions: + import tflite.TransposeOptions + if builtin_option_type == tflite.BuiltinOptions.BuiltinOptions().TransposeOptions: + + transpose_option = tflite.TransposeOptions.TransposeOptions() + transpose_option.Init(selected_builtin_option.Bytes, selected_builtin_option.Pos) + + tflite.TransposeOptions.TransposeOptionsStart(new_builder) + return tflite.TransposeOptions.TransposeOptionsEnd(new_builder) # ReducerOptions import tflite.ReducerOptions -- 2.7.4