Skip to content

Commit

Permalink
Fix LayerOutput.parents for some layers and mixed_layer for Operator (P…
Browse files Browse the repository at this point in the history
  • Loading branch information
emailweixu authored and reyoung committed Sep 13, 2016
1 parent 3fc99a2 commit d6cc520
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion python/paddle/trainer_config_helpers/layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ def __init__(self, name, layer_type, parents=None, activation=None,
assert LayerType.is_layer_type(layer_type)
self.name = name
self.layer_type = layer_type
if parents is not None and type(parents) != list:
parents = [parents]
self.parents = [] if parents is None else parents
self.activation = activation
self.num_filters = num_filters
Expand Down Expand Up @@ -512,7 +514,7 @@ def __add__(self, other):
:rtype: MixedLayerType
"""
if not self.finalized:
assert isinstance(other, Projection)
assert isinstance(other, Projection) or isinstance(other, Operator)
self.inputs.append(other)
self.parents.append(other.origin)
return self
Expand Down

0 comments on commit d6cc520

Please sign in to comment.