From 880c2a94a6a406c4d1d1fae9895f4933335d2e62 Mon Sep 17 00:00:00 2001 From: pangyoki Date: Tue, 26 Apr 2022 02:25:05 +0000 Subject: [PATCH] fix format --- python/paddle/fluid/backward.py | 4 ++-- python/paddle/fluid/tests/unittests/gradient_checker.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/fluid/backward.py b/python/paddle/fluid/backward.py index 8e196508233..f34060358cd 100755 --- a/python/paddle/fluid/backward.py +++ b/python/paddle/fluid/backward.py @@ -1313,8 +1313,8 @@ def _append_backward_vars_(block, start_op_idx, grad_to_var, grad_info_map): if grad_var_ins: existing_grad_var_ins = [ var for var in grad_var_ins - if block.desc.has_var_recursive(cpt.to_bytes(var)) or - var in parent_op_vars + if block.desc.has_var_recursive(cpt.to_bytes(var)) or var in + parent_op_vars ] if not existing_grad_var_ins: ''' diff --git a/python/paddle/fluid/tests/unittests/gradient_checker.py b/python/paddle/fluid/tests/unittests/gradient_checker.py index de084b79672..5080fbfd648 100644 --- a/python/paddle/fluid/tests/unittests/gradient_checker.py +++ b/python/paddle/fluid/tests/unittests/gradient_checker.py @@ -312,7 +312,7 @@ def grad_check(x, _compute_analytical_jacobian(prog, clone_x, clone_y, place, scope)) for i, (x_idx, - y_idx) in enumerate(product(* [range(len(x)), range(len(y))])): + y_idx) in enumerate(product(*[range(len(x)), range(len(y))])): a = analytical[y_idx][x_idx] n = numerical[x_idx][y_idx] if not np.allclose(a, n, rtol, atol): -- GitLab