提交 d6cc5203 编写于 作者: E emailweixu 提交者: Yu Yang

Fix LayerOutput.parents for some layers and mixed_layer for Operator (#69)

上级 3fc99a23
...@@ -171,6 +171,8 @@ class LayerOutput(object): ...@@ -171,6 +171,8 @@ class LayerOutput(object):
assert LayerType.is_layer_type(layer_type) assert LayerType.is_layer_type(layer_type)
self.name = name self.name = name
self.layer_type = layer_type 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.parents = [] if parents is None else parents
self.activation = activation self.activation = activation
self.num_filters = num_filters self.num_filters = num_filters
...@@ -512,7 +514,7 @@ class MixedLayerType(LayerOutput): ...@@ -512,7 +514,7 @@ class MixedLayerType(LayerOutput):
:rtype: MixedLayerType :rtype: MixedLayerType
""" """
if not self.finalized: if not self.finalized:
assert isinstance(other, Projection) assert isinstance(other, Projection) or isinstance(other, Operator)
self.inputs.append(other) self.inputs.append(other)
self.parents.append(other.origin) self.parents.append(other.origin)
return self return self
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册