From 538f1ad28f766c0e47ef4eef2ec59e187ba30f8e Mon Sep 17 00:00:00 2001 From: fengjiayi Date: Fri, 19 Jan 2018 15:24:14 +0800 Subject: [PATCH] tiny fix --- python/paddle/v2/fluid/clip.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/python/paddle/v2/fluid/clip.py b/python/paddle/v2/fluid/clip.py index 9800ad7c5d0..d97cd9ecc93 100644 --- a/python/paddle/v2/fluid/clip.py +++ b/python/paddle/v2/fluid/clip.py @@ -124,11 +124,7 @@ class GradientClipByGlobalNorm(BaseGradientClipAttr): cls.global_norm_var = layers.fill_constant( shape=[1], dtype="float32", value=0.0) - cls.local_norm_var = framework.default_main_program().block( - 0).create_var( - name=framework.unique_name("local_norm"), - dtype="float32", - persistable=False) + cls.local_norm_var = layers.create_tensor(dtype="float32") cls.clip_norm_var = layers.fill_constant( shape=[1], dtype="float32", value=clip_norm) -- GitLab