[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-05-08 08:51:03 +00:00
commit ba6b279e61

View file

@ -68,7 +68,10 @@ def _get_env_int(keys):
def _infer_distributed_ranks():
if torch.distributed.is_available() and getattr(torch.distributed, "is_initialized", lambda: False)():
if (
torch.distributed.is_available()
and getattr(torch.distributed, "is_initialized", lambda: False)()
):
try:
return torch.distributed.get_rank(), torch.distributed.get_world_size()
except Exception: