diff --git a/python/paddle/v2/config_base.py b/python/paddle/v2/config_base.py index 96a1c70eded27261d5bad85288f46c20ce23fe45..cb98866d874e35b9fda8e170004d687329b7d3e3 100644 --- a/python/paddle/v2/config_base.py +++ b/python/paddle/v2/config_base.py @@ -117,7 +117,9 @@ class Layer(object): continue layer.to_proto(context=context) - if self.use_context_name(): + if self.context_name() is None: + return ret_val + elif self.use_context_name(): return context[self.context_name()] else: return context[self.name]