Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ select = [
"PLR1701",
# "PLR1711", # Confirmation required
"PLR1722",
"PLW3301", # Confirmation required
"PLW3301",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emmmm,是让你在别的 PR 改,但需要等那个 PR 先 merge 呀:joy:,这样这两个 PR 必然会冲突的

算了到时候解决冲突吧

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯,我以为都会有冲突的😢,这个 pr 没 merge develop 进来之前就会和之前的有冲突?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为和 #57400 改了同一行

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#57400 已合入,可以解决冲突了

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

]
unfixable = [
"NPY001"
Expand Down Expand Up @@ -111,7 +111,6 @@ ignore = [
"F403",
"B010",
"PLR1722",
"C403",
"UP034",
"C405",
"C417",
Expand Down
10 changes: 5 additions & 5 deletions python/paddle/base/backward.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,9 @@ def _op_can_be_removed_(op_desc, no_grad_set):
return False

# Remove ops whose outputs are all in no_grad_dict
target_grad_var_names = set(
[var.name + core.grad_var_suffix() for var in target_vars]
)
target_grad_var_names = {
var.name + core.grad_var_suffix() for var in target_vars
}
op_descs = [
op_desc
for op_desc in op_descs
Expand Down Expand Up @@ -2266,7 +2266,7 @@ def _get_output_names(cur_block, targets):
"""

block = targets[0].block if targets else cur_block
current_output_names = set([out.name for out in targets])
current_output_names = {out.name for out in targets}

# 1. If `targets` in cur_block or the ancestral block of `cur_block`
if block.idx == cur_block.idx or _is_ancestor_block(block, cur_block):
Expand Down Expand Up @@ -2336,7 +2336,7 @@ def _find_op_path_(
The forward op path of block corresponding to backward op.
"""

input_names = set([inp.name for inp in inputs])
input_names = {inp.name for inp in inputs}
output_names = _get_output_names(block, targets)
if op_path_dict is None:
op_path_dict = dict()
Expand Down