summaryrefslogtreecommitdiff
path: root/tools/tflitefile_tool
diff options
context:
space:
mode:
author윤지영/동작제어Lab(SR)/Engineer/삼성전자 <jy910.yun@samsung.com>2018-11-20 14:13:15 +0900
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>2018-11-20 14:13:15 +0900
commitde40093f2991879aab1234779ca56e0685ed4035 (patch)
treed7c048bd647f09814a5a522cb5d75c39afcfb292 /tools/tflitefile_tool
parentcf56107950b7b2a592536edb49bcff58c19a56e6 (diff)
downloadnnfw-de40093f2991879aab1234779ca56e0685ed4035.tar.gz
nnfw-de40093f2991879aab1234779ca56e0685ed4035.tar.bz2
nnfw-de40093f2991879aab1234779ca56e0685ed4035.zip
Fix non-string passed to CreateString issue in tfltool (#3645)
If the operator_codes is empty, select_operator.py tool occurs an error. This patch is fixed the issue. Signed-off-by: Jiyoung Yun <jy910.yun@samsung.com>
Diffstat (limited to 'tools/tflitefile_tool')
-rwxr-xr-xtools/tflitefile_tool/select_operator.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/tflitefile_tool/select_operator.py b/tools/tflitefile_tool/select_operator.py
index 27030e96d..1233045b7 100755
--- a/tools/tflitefile_tool/select_operator.py
+++ b/tools/tflitefile_tool/select_operator.py
@@ -76,8 +76,8 @@ def GenerateOperatorCodes(new_builder, sample_model, used_operators_dic):
if operator_code_idx in used_operators_dic:
operator_code = sample_model.OperatorCodes(operator_code_idx)
operator_code_string = operator_code.CustomCode()
- if (operator_code_string !=
- "") and (not operator_code_string in new_operator_code_string_list):
+ if operator_code_string and (operator_code_string != "") and (
+ not operator_code_string in new_operator_code_string_list):
new_operator_code_string_list[
operator_code_string] = new_builder.CreateString(operator_code_string)
@@ -802,7 +802,7 @@ def GenerateSubgraph(new_builder, selected_subgraph, opcode_list, new_input_tens
# Name
subgraph_name = selected_subgraph.Name()
have_name = False
- if subgraph_name != "":
+ if subgraph_name and subgraph_name != "":
have_name = True
new_subgraph_name = new_builder.CreateString(subgraph_name)