From ed7334d694aa32325697af8a85250fed5d642387 Mon Sep 17 00:00:00 2001 From: Haonan Date: Wed, 23 Nov 2016 11:01:45 -0800 Subject: [PATCH] fix the has_LayerOutput boolean for StaticInput as the input of recurrent_group --- python/paddle/trainer_config_helpers/layers.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/paddle/trainer_config_helpers/layers.py b/python/paddle/trainer_config_helpers/layers.py index d984e84320..9a45a51589 100644 --- a/python/paddle/trainer_config_helpers/layers.py +++ b/python/paddle/trainer_config_helpers/layers.py @@ -2853,11 +2853,11 @@ def recurrent_group(step, :type targetInlink: LayerOutput|SubsequenceInput :param is_generating: If is generating, none of input type should be LayerOutput; - else, for training or testing, one of the input type must + else, for training or testing, one of the input type must be LayerOutput. : type is_generating: bool - + :return: LayerOutput object. :rtype: LayerOutput """ @@ -2905,15 +2905,16 @@ def recurrent_group(step, seq_reversed=reverse, target_inlinkname=targetInlinkName) in_args = [] - has_LayerOutput = True + has_LayerOutput = False for each_input in input: assert is_single_input(each_input) if isinstance(each_input, LayerOutput): in_args.append(each_input) + has_LayerOutput = True elif isinstance(each_input, SubsequenceInput): in_args.append(each_input.input) + has_LayerOutput = True else: - has_LayerOutput = False mem_name = "__%s_memory__" % each_input.input.name mem = memory( name=mem_name, -- GitLab