From e233b91a23d86f436c218806b6d132f3ce4d4d2c Mon Sep 17 00:00:00 2001 From: Jiabin Yang Date: Fri, 8 Mar 2019 14:04:49 +0800 Subject: [PATCH] test=develop, fix using create_parameter with attr set to False error (#16115) --- python/paddle/fluid/layer_helper_base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/paddle/fluid/layer_helper_base.py b/python/paddle/fluid/layer_helper_base.py index d4b38137e4e..3504cb79351 100644 --- a/python/paddle/fluid/layer_helper_base.py +++ b/python/paddle/fluid/layer_helper_base.py @@ -270,6 +270,9 @@ class LayerHelperBase(object): attr = copy.deepcopy(attr) if attr is None: attr = ParamAttr._to_attr(attr) + if not attr: + return None + assert isinstance(attr, ParamAttr) suffix = 'b' if is_bias else 'w' if attr.name is None: -- GitLab