Skip to content

Commit

Permalink
Add program
Browse files Browse the repository at this point in the history
  • Loading branch information
reyoung committed Jun 17, 2018
1 parent 958ab99 commit 08995ac
Show file tree
Hide file tree
Showing 4 changed files with 244 additions and 34 deletions.
4 changes: 2 additions & 2 deletions python/paddle/fluid/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def set_gradient_clip(clip, param_list=None, program=None):
def append_gradient_clip_ops(param_grad):
context = dict()
for p, g in param_grad:
with p.block.program.optimized_guard(p):
with p.block.program.optimization_guard(p):
clip_attr = getattr(p, 'gradient_clip_attr', NullGradientClipAttr())
if clip_attr is None:
clip_attr = NullGradientClipAttr()
Expand All @@ -228,7 +228,7 @@ def append_gradient_clip_ops(param_grad):

res = []
for p, g in param_grad:
with p.block.program.optimized_guard(p):
with p.block.program.optimization_guard(p):
res.append(clip_attr.create_operators(param=p, grad=g))

return res
Expand Down
Loading

0 comments on commit 08995ac

Please sign in to comment.