From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Thu, 26 Jul 2018 08:24:08 +0000 (+0900) Subject: [model_parser] Print activation function as name (#2092) X-Git-Tag: 0.2~385 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=08f66497252c8ef7f5487d7ba66f4da72ea8e7de;p=platform%2Fcore%2Fml%2Fnnfw.git [model_parser] Print activation function as name (#2092) Print Activation Function Type as its name, not the integer code. Signed-off-by: Hanjoung Lee --- diff --git a/tools/tflitefile_tool/operator_wrapping.py b/tools/tflitefile_tool/operator_wrapping.py index 118436a..780fa20 100755 --- a/tools/tflitefile_tool/operator_wrapping.py +++ b/tools/tflitefile_tool/operator_wrapping.py @@ -3,6 +3,7 @@ import tflite.Operator import tflite.OperatorCode import tflite.BuiltinOperator +import tflite.ActivationFunctionType from tensor_wrapping import Tensor from operation import Operation from perf_predictor import PerfPredictor @@ -24,6 +25,8 @@ def BuildEnumClassStrMap(obj): class EnumStrMaps(): BuiltinOpcode = BuildEnumClassStrMap(tflite.BuiltinOperator.BuiltinOperator()) + ActivationFunctionType = BuildEnumClassStrMap( + tflite.ActivationFunctionType.ActivationFunctionType()) def GetStrTensorIndex(tensors): @@ -124,8 +127,7 @@ class Operator(object): # fused activation function try: activation_code = options.FusedActivationFunction() - fused_activation = str( - activation_code) # TODO print the name, not the integer code + fused_activation = EnumStrMaps.ActivationFunctionType[activation_code] print("\tFused Activation: " + fused_activation) except AttributeError: # This operator does not support FusedActivationFunction