Skip to content

Commit 538f1ad

Browse files
committed
tiny fix
1 parent 408a6b8 commit 538f1ad

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

python/paddle/v2/fluid/clip.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,7 @@ def init(cls, clip_norm):
124124

125125
cls.global_norm_var = layers.fill_constant(
126126
shape=[1], dtype="float32", value=0.0)
127-
cls.local_norm_var = framework.default_main_program().block(
128-
0).create_var(
129-
name=framework.unique_name("local_norm"),
130-
dtype="float32",
131-
persistable=False)
127+
cls.local_norm_var = layers.create_tensor(dtype="float32")
132128
cls.clip_norm_var = layers.fill_constant(
133129
shape=[1], dtype="float32", value=clip_norm)
134130

0 commit comments

Comments
 (0)