[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
2de2c29d3a
commit
ba6b279e61
1 changed files with 4 additions and 1 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue