diff --git a/python/paddle/v2/layer.py b/python/paddle/v2/layer.py index f6b3dbf39a515d8780835c08ae77224f15717ac1..67b7192bb74b7440567a27df1394a754027f702f 100644 --- a/python/paddle/v2/layer.py +++ b/python/paddle/v2/layer.py @@ -235,9 +235,9 @@ def __trim_submodel__(old_submodel, layer_names, input_layer_names, def parse_network(output_layers, extra_layers=None): if not isinstance(output_layers, collections.Sequence): output_layers = [output_layers] - if extra_layers is not None and not isinstance(extra_layers, - collections.Sequence): - extra_layers = [extra_layers] + if extra_layers is not None: + if not isinstance(extra_layers, collections.Sequence): + extra_layers = [extra_layers] else: extra_layers = [] diff --git a/python/paddle/v2/topology.py b/python/paddle/v2/topology.py index 67e5535a0cc73b33297b01c6083623345108934f..5109dc58fe5128ab4144224f76190c5cfdb69f6a 100644 --- a/python/paddle/v2/topology.py +++ b/python/paddle/v2/topology.py @@ -31,7 +31,6 @@ class Topology(object): def __init__(self, layers, extra_layers=None): def __check__(layers): if not isinstance(layers, collections.Sequence): - __check_layer_type__(layers) layers = [layers] for layer in layers: __check_layer_type__(layer)