Skip to content

Commit

Permalink
add golbal_lower_update list
Browse files Browse the repository at this point in the history
  • Loading branch information
levi131 committed Apr 20, 2022
1 parent 56c9c67 commit 6be9055
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/paddle/autograd/primx.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
from .primrules import get_input_var_list, get_output_var_list
from collections import OrderedDict

#TODO(lml): this is a bad and unsafe design used for get laplace2d program, please refactor it later
global_lower_update = []


def flatten(inp):
if inp is None or isinstance(inp, paddle.fluid.framework.Variable):
Expand Down Expand Up @@ -529,6 +532,12 @@ def bind_name(names, to_bind):
attrs=attrs)
block.ops.append(op)

if global_lower_update is not None:
for i in range(len(global_lower_update)):
if global_lower_update[i].name in to_bind:
global_lower_update[i] = vlt[to_bind[global_lower_update[i]
.name]]

if update_var_list is not None:
for i in range(len(update_var_list)):
if update_var_list[i].name in to_bind:
Expand Down

0 comments on commit 6be9055

Please sign in to comment.