[2/N] More ruff SIM fixes (#165031)

This is follow-up of #164695 to apply ruff SIM rules to more files. Most changes are about simplifying dict.get because None is already the default value.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/165031
Approved by: https://github.com/mlazos
This commit is contained in:
Yuanyuan Chen
2025-10-14 14:22:49 +00:00
committed by PyTorch MergeBot
parent 1fa11f42b1
commit fbe0d20a17
52 changed files with 98 additions and 138 deletions

View File

@ -5307,7 +5307,7 @@ def grid_sampler_3d_backward(
@register_meta([aten.full.default])
def full(size, fill_value, *args, **kwargs):
dtype = kwargs.get("dtype", None)
dtype = kwargs.get("dtype")
if not dtype:
dtype = utils.get_dtype(fill_value)
kwargs["dtype"] = dtype