Skip to content

Commit 08995ac

Browse files
committed
Add program
1 parent 958ab99 commit 08995ac

File tree

4 files changed

+244
-34
lines changed

4 files changed

+244
-34
lines changed

python/paddle/fluid/clip.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def set_gradient_clip(clip, param_list=None, program=None):
215215
def append_gradient_clip_ops(param_grad):
216216
context = dict()
217217
for p, g in param_grad:
218-
with p.block.program.optimized_guard(p):
218+
with p.block.program.optimization_guard(p):
219219
clip_attr = getattr(p, 'gradient_clip_attr', NullGradientClipAttr())
220220
if clip_attr is None:
221221
clip_attr = NullGradientClipAttr()
@@ -228,7 +228,7 @@ def append_gradient_clip_ops(param_grad):
228228

229229
res = []
230230
for p, g in param_grad:
231-
with p.block.program.optimized_guard(p):
231+
with p.block.program.optimization_guard(p):
232232
res.append(clip_attr.create_operators(param=p, grad=g))
233233

234234
return res

0 commit comments

Comments
 (0)