[BE]: Enable ruff rule PIE800 - unnecessary nested dict expansion (#113880)

Adds an additional list which removes unnecessary dict literal unpacking, also applies the fixes.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/113880
Approved by: https://github.com/albanD
This commit is contained in:
Aaron Gokaslan
2023-11-16 22:34:34 +00:00
committed by PyTorch MergeBot
parent bdf0b196db
commit d9f2cf9974
4 changed files with 8 additions and 9 deletions

View File

@ -222,13 +222,11 @@ def map_to_dtype(e, dtype):
def deserialize_args(inps):
inps = inps.strip().strip("'")
global_vals = {
**{
"T": deserialize_tensor,
"ST": deserialize_sparse_tensor,
"th": torch,
"inf": math.inf,
"torch": torch,
},
"T": deserialize_tensor,
"ST": deserialize_sparse_tensor,
"th": torch,
"inf": math.inf,
"torch": torch,
**dtype_abbrs_parsing,
}
# f strings introduce quotations we dont want