From 86490c57e126bd1fbb49dd11486f146746f56f31 Mon Sep 17 00:00:00 2001 From: qili93 Date: Wed, 3 Jun 2020 08:52:48 +0000 Subject: [PATCH] fix ParamAttr api in create_parameter, test=develop --- x2paddle/core/fluid_code.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/x2paddle/core/fluid_code.py b/x2paddle/core/fluid_code.py index a539750..6f4df3f 100644 --- a/x2paddle/core/fluid_code.py +++ b/x2paddle/core/fluid_code.py @@ -88,6 +88,8 @@ class Layer(object): for key, value in param_attr.items(): if '\n' in str(value): value = string(str(value).replace('\n', ',')) + if str(key) == 'attr': + value = 'ParamAttr(' + str(value) + ')' layer_code = layer_code + key + "={}, ".format(value) layer_code = layer_code.strip(", ") -- GitLab