Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CodeStyle][Ruff][BUAA][E-1,K-11] Fix Ruff RUF017 and RUF019 diagnostic for 2 files in python/paddle/distributed/auto_parallel/static/ and test/xpu/ #67185

Merged
merged 1 commit into from
Aug 8, 2024
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
5 changes: 4 additions & 1 deletion python/paddle/distributed/auto_parallel/static/reshard.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


import copy
import operator
from collections import OrderedDict
from functools import reduce

Expand Down Expand Up @@ -976,7 +977,9 @@ def remove_no_need_in_main(
)
# 'feed_var_names' cannot be removed from auto_parallel_main_prog
feed_var_names = []
for var in sum(list(dist_context.serial_feed_vars.values()), []):
for var in reduce(
operator.iadd, list(dist_context.serial_feed_vars.values()), []
):
feed_var_names.append(var.name)
Remover.remove_no_need_vars(
auto_parallel_main_prog, dist_params_grads, feed_var_names
Expand Down
2 changes: 1 addition & 1 deletion test/xpu/op_test_xpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def get_grad_with_place(

# oneDNN numeric gradient should use CPU kernel
use_onednn = False
if "use_mkldnn" in op_attrs and op_attrs["use_mkldnn"]:
if op_attrs.get("use_mkldnn"):
op_attrs["use_mkldnn"] = False
use_onednn = True

Expand Down