[BE][PYFMT] migrate PYFMT for torch._dynamo to ruff format (#144549)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/144549
Approved by: https://github.com/jansel
This commit is contained in:
Xuehai Pan
2025-02-28 05:38:28 +08:00
committed by PyTorch MergeBot
parent edc5bf91d2
commit 3ce352e389
45 changed files with 428 additions and 395 deletions

View File

@ -140,15 +140,13 @@ def requires_bwd_pass(out: Any) -> bool:
@overload
def reduce_to_scalar_loss(out: torch.Tensor) -> torch.Tensor:
...
def reduce_to_scalar_loss(out: torch.Tensor) -> torch.Tensor: ...
@overload
def reduce_to_scalar_loss(
out: Union[list[Any], tuple[Any, ...], dict[Any, Any]]
) -> float:
...
out: Union[list[Any], tuple[Any, ...], dict[Any, Any]],
) -> float: ...
def reduce_to_scalar_loss(out: Any) -> Union[torch.Tensor, float]: