PEP585 update - torch/distributed (#145164)

See #145101 for details.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/145164
Approved by: https://github.com/bobrenjc93
This commit is contained in:
Aaron Orenstein
2025-01-20 14:50:01 -08:00
committed by PyTorch MergeBot
parent c6986ca2e1
commit 00ffeca1b1
79 changed files with 805 additions and 860 deletions

View File

@ -2,7 +2,7 @@
import warnings
from abc import ABC, abstractmethod
from types import TracebackType
from typing import Any, List, NamedTuple, Optional, Type
from typing import Any, NamedTuple, Optional
import torch
import torch.distributed as dist
@ -165,7 +165,7 @@ class Join:
def __init__(
self,
joinables: List[Joinable],
joinables: list[Joinable],
enable: bool = True,
throw_on_early_termination: bool = False,
**kwargs,
@ -228,7 +228,7 @@ class Join:
def __exit__(
self,
type: Optional[Type[BaseException]],
type: Optional[type[BaseException]],
value: Optional[BaseException],
traceback: Optional[TracebackType],
):