[tfltool] Enable select operator for LogicalOr op (#3824)
authorShubham Gupta/SNAP /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Tue, 4 Dec 2018 01:04:24 +0000 (06:34 +0530)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Tue, 4 Dec 2018 01:04:24 +0000 (10:04 +0900)
This patch will enalbe select operator for Logicalor op

Signed-off-by: shubham <shub98.gupta@samsung.com>
tools/tflitefile_tool/select_operator.py

index fc570d8..c037472 100755 (executable)
@@ -718,7 +718,17 @@ def GenerateBuiltinOption(new_builder, selected_builtin_option, builtin_option_t
     # ArgMinOptions: not supported
     # FakeQuantOptions: not supported
     # PackOptions: not supported
-    # LogicalOrOptions: not supported
+
+    # LogicalOrOptions:
+    import tflite.LogicalOrOptions
+    if builtin_option_type == tflite.BuiltinOptions.BuiltinOptions().LogicalOrOptions:
+
+        logical_or_option = tflite.LogicalAndOptions.LogicalOrOptions()
+        logical_or_option.Init(selected_builtin_option.Bytes, selected_builtin_option.Pos)
+
+        tflite.LogicalOrOptions.LogicalOrOptionsStart(new_builder)
+        return tflite.LogicalOrOptions.LogicalOrOptionsEnd(new_builder)
+
     # OneHotOptions: not supported
     # LogicalNotOptions: not supported