@staticmethod<EOL><INDENT>def __build_node_id_2_klayer(kmodel, node_id_to_config_layer):<DEDENT>
node_id_to_config_layer[kmodel.name] = kmodel  <EOL>def gather_result(layers):<EOL><INDENT>if layers:  <EOL><INDENT>for layer in layers:<EOL><INDENT>if layer.name not in node_id_to_config_layer:<EOL><INDENT>node_id_to_config_layer[layer.name] = layer<EOL>DefinitionLoader.__build_node_id_2_klayer(layer, node_id_to_config_layer)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if hasattr(kmodel, "<STR_LIT>"):<EOL><INDENT>gather_result(kmodel.layers)<EOL><DEDENT>if hasattr(kmodel, "<STR_LIT>"):<EOL><INDENT>gather_result(kmodel.flattened_layers)<EOL><DEDENT>
The result would contain all of the layers including nested layers.
:param kmodel: a keras model which can be Sequential or Model
:param node_id_to_config_layer: a container to store the result