From fc7d0ca1cd64cca9109756e693145ceea9c60c3b Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Tue, 26 Dec 2017 16:09:01 +0800 Subject: [PATCH] fix errors --- python/paddle/v2/fluid/backward.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/python/paddle/v2/fluid/backward.py b/python/paddle/v2/fluid/backward.py index 9bc3e73f5..e05750c5b 100644 --- a/python/paddle/v2/fluid/backward.py +++ b/python/paddle/v2/fluid/backward.py @@ -158,11 +158,9 @@ def _append_backward_ops_(target, op_type="fill_constant", inputs={}, outputs={"Out": [grad_target_name]}, - attrs={ - "shape": [1], - "value": 1.0, - "dtype": core.DataType.FP32 - })) + attrs={"shape": [1], + "value": 1.0, + "dtype": target.dtype})) for op_desc in grad_op_descs: new_op_desc = target_block.desc.append_op() new_op_desc.copy_from(op_desc) -- GitLab