mirror of
https://github.com/pytorch/pytorch.git
synced 2025-11-11 22:34:53 +08:00
Fix use-dict-literal lint (#83718)
Fix use-dict-literal pylint suggestions by changing `dict()` to `{}`. This PR should do the change for every Python file except test/jit/test_list_dict.py, where I think the intent is to test the constructor.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/83718
Approved by: https://github.com/albanD
This commit is contained in:
committed by
PyTorch MergeBot
parent
fc470cf980
commit
591222f5d9
@ -383,7 +383,7 @@ Attempted to convert a derivative formula for a mutable operator
|
||||
)
|
||||
continue
|
||||
|
||||
fw_derivative_dict: Dict[str, Sequence[ForwardDerivative]] = dict()
|
||||
fw_derivative_dict: Dict[str, Sequence[ForwardDerivative]] = {}
|
||||
for key, info in info_dict.items():
|
||||
if not info.forward_derivatives:
|
||||
fw_derivative_dict[key] = []
|
||||
|
||||
@ -1327,7 +1327,7 @@ def dispatch_lambda_exprs(
|
||||
arg_parser_outputs = arg_parser_output_exprs(ps, f)
|
||||
lambda_args = dispatch_lambda_args(ps, f)
|
||||
inits: List[str] = []
|
||||
lambda_args_exprs: Dict[str, str] = dict()
|
||||
lambda_args_exprs: Dict[str, str] = {}
|
||||
|
||||
has_toptions = has_tensor_options(f)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user