From 1e21259d5c36fd7912e957ce93d2464b3ae2f2fe Mon Sep 17 00:00:00 2001 From: caoying03 Date: Wed, 7 Jun 2017 10:54:10 +0800 Subject: [PATCH] fix the bug of parsing evaluator in SRL in PaddleBook. --- python/paddle/v2/layer.py | 6 +++--- python/paddle/v2/topology.py | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/python/paddle/v2/layer.py b/python/paddle/v2/layer.py index f6b3dbf39a5..67b7192bb74 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 67e5535a0cc..5109dc58fe5 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) -- GitLab