Browse Source

!1154 Fix a function has 51 lines which is over 50

From: @liangtianshu
Reviewed-by: @liuchongming74,@yelihua,@ouwenchang
Signed-off-by: @ouwenchang
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
53d105a091
1 changed files with 1 additions and 4 deletions
  1. +1
    -4
      mindinsight/mindconverter/graph_based_converter/generator/generator.py

+ 1
- 4
mindinsight/mindconverter/graph_based_converter/generator/generator.py View File

@@ -105,7 +105,7 @@ class CodeStruct:
init_lines += init_str
cons_lines += cons_str

elif isinstance(struct, ModuleStruct):
else: # is ModuleStruct
# check if this instance generated CodeStruct
if GlobalContext().code_structs.get(struct.pattern_id) is None:
CodeStruct(struct, repeated_submodules)
@@ -115,9 +115,6 @@ class CodeStruct:
init_lines.append(f"{SECOND_LEVEL_INDENT}{' = '.join(code_line_init)}")
cons_lines.append(f"{SECOND_LEVEL_INDENT}{' = '.join(code_line_construct)}")

else:
raise TypeError("Unable to generate code from args are not ModuleStruct or NodeStruct.")

# define header of init block
self.new_line = f"{FIRST_LEVEL_INDENT}def __init__({', '.join(module_def_args)}):"
self.new_line = f"{SECOND_LEVEL_INDENT}super({class_name}, self).__init__()"


Loading…
Cancel
Save