Skip to content

Commit

Permalink
fix the has_LayerOutput boolean for StaticInput as the input of recur…
Browse files Browse the repository at this point in the history
…rent_group
  • Loading branch information
Haonan committed Nov 23, 2016
1 parent 85f0e18 commit ed7334d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions python/paddle/trainer_config_helpers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2853,11 +2853,11 @@ def step(input):
: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
"""
Expand Down Expand Up @@ -2905,15 +2905,16 @@ def map_in_links(x):
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,
Expand Down

0 comments on commit ed7334d

Please sign in to comment.