Skip to content

Commit

Permalink
Fix unittest for rnn.
Browse files Browse the repository at this point in the history
  • Loading branch information
reyoung committed Apr 5, 2017
1 parent b968b5e commit 606a99d
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions python/paddle/v2/config_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ def to_proto(self, context):

# parse myself.
ret_val = self.to_proto_impl(**kwargs)
if self.context_name() is not None:
assert self.context_name() not in context
# add myself to context

if self.context_name() is not None and \
self.context_name() not in context:
context[self.context_name()] = ret_val

# parse children.
Expand All @@ -117,7 +117,10 @@ def to_proto(self, context):
continue
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):
raise NotImplementedError()
Expand Down

0 comments on commit 606a99d

Please sign in to comment.