From ca367a80e3eb019aa5290055552228f844ade130 Mon Sep 17 00:00:00 2001 From: dangqingqing Date: Wed, 1 Mar 2017 10:58:22 +0800 Subject: [PATCH] follow comments --- python/paddle/v2/topology.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/python/paddle/v2/topology.py b/python/paddle/v2/topology.py index 6329915350b..e2709e39de9 100644 --- a/python/paddle/v2/topology.py +++ b/python/paddle/v2/topology.py @@ -74,12 +74,10 @@ class Topology(object): if isinstance(layer, v2_layer.DataLayerV2): data_layers[layer.name] = layer if not isinstance(layer, collections.Sequence): - for parent_layer in layer.__parent_layers__.values(): + layer = [layer] + for each_l in layer: + for parent_layer in each_l.__parent_layers__.values(): find_data_layer(parent_layer) - else: - for each_l in layer: - for parent_layer in each_l.__parent_layers__.values(): - find_data_layer(parent_layer) for layer in self.layers: find_data_layer(layer) @@ -93,8 +91,8 @@ class Topology(object): """ data_types_lists = [] + data_layers = self.data_layers() for each in self.__model_config__.input_layer_names: - data_layers = self.data_layers() data_types_lists.append((each, data_layers[each].type)) return data_types_lists -- GitLab