From: Hyeongseok Oh Date: Wed, 26 Aug 2020 03:18:06 +0000 (+0900) Subject: [tflitefile_tool] Support leaky_relu in select_operator.py (#3983) X-Git-Tag: 1.9.0~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a84a85f132bdb97d0716dd7fe9d21f9f78637fe;p=platform%2Fcore%2Fml%2Fnnfw.git [tflitefile_tool] Support leaky_relu in select_operator.py (#3983) select_operator.py can handle LeakyReluOption for leaky_relu operation Signed-off-by: Hyeongseok Oh --- diff --git a/tools/tflitefile_tool/select_operator.py b/tools/tflitefile_tool/select_operator.py index dcafd75..863edea 100755 --- a/tools/tflitefile_tool/select_operator.py +++ b/tools/tflitefile_tool/select_operator.py @@ -875,7 +875,18 @@ def GenerateBuiltinOption(new_builder, selected_builtin_option, builtin_option_t # FloorModOptions: not supported # RangeOptions: not supported # ResizeNearestNeighborOptions: not supported - # LeakyReluOptions: not supported + + # LeakyReluOptions + import tflite.LeakyReluOptions + if builtin_option_type == tflite.BuiltinOptions.BuiltinOptions().LeakyReluOptions: + + leaky_relu_option = tflite.LeakyReluOptions.LeakyReluOptions() + leaky_relu_option.Init(selected_builtin_option.Bytes, selected_builtin_option.Pos) + + tflite.LeakyReluOptions.LeakyReluOptionsStart(new_builder) + tflite.LeakyReluOptions.LeakyReluOptionsAddAlpha(new_builder, + leaky_relu_option.Alpha()) + return tflite.LeakyReluOptions.LeakyReluOptionsEnd(new_builder) # SquaredDifferenceOptions import tflite.SquaredDifferenceOptions