Fix unittest for rnn.

release/0.10.0
Yu Yang 9 years ago
parent b968b5ef66
commit 606a99d935

@ -99,9 +99,9 @@ class Layer(object):
# parse myself. # parse myself.
ret_val = self.to_proto_impl(**kwargs) ret_val = self.to_proto_impl(**kwargs)
if self.context_name() is not None:
assert self.context_name() not in context if self.context_name() is not None and \
# add myself to context self.context_name() not in context:
context[self.context_name()] = ret_val context[self.context_name()] = ret_val
# parse children. # parse children.
@ -117,7 +117,10 @@ class Layer(object):
continue continue
layer.to_proto(context=context) layer.to_proto(context=context)
return ret_val if self.use_context_name():
return context[self.context_name()]
else:
return context[self.name]
def to_proto_impl(self, **kwargs): def to_proto_impl(self, **kwargs):
raise NotImplementedError() raise NotImplementedError()

Loading…
Cancel
Save