From d85a0dfafc1610a5ab5dc04d9315acba3a35b73a Mon Sep 17 00:00:00 2001 From: LoneRanger <836253168@qq.com> Date: Wed, 27 Sep 2023 12:04:27 +0800 Subject: [PATCH] [CodeStyle][task 30] enable ruff C411 rule in python/paddle/base (#57707) * Update pyproject.toml * fix bug --- pyproject.toml | 1 - python/paddle/base/backward.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 41761c226c8b1..2326d45639537 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,6 @@ ignore = [ "UP030", "C405", "B019", # Confirmation required - "C411", "C416", "F821", "PLC0414", diff --git a/python/paddle/base/backward.py b/python/paddle/base/backward.py index 59bf66ebde7b6..6d30823d4bf4a 100755 --- a/python/paddle/base/backward.py +++ b/python/paddle/base/backward.py @@ -760,7 +760,7 @@ def _op_can_be_removed_(op_desc, no_grad_set): ] = grad_op_id_to_fwd_op[op_desc.original_id()] to_insert.append((new_op_desc, idx)) - list([op_descs.insert(p[1], p[0]) for p in reversed(to_insert)]) + [op_descs.insert(p[1], p[0]) for p in reversed(to_insert)] return op_descs