Skip to content

Commit 085b5b3

Browse files
otajlexierule
authored andcommitted
Fixed TypeError on 1.7.6 when torch.distributed unavailable (#14809)
* Fixed TypeError on 1.7.6 when distributed unavailable * changelog
1 parent e1a4370 commit 085b5b3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/pytorch_lightning/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
1313
- Break HPU Graphs into two parts (forward + backward as one and optimizer as another) for better performance ([#14656](https://github.com/Lightning-AI/lightning/pull/14656))
1414
- Fixed torchscript error with ensembles of LightningModules ([#14657](https://github.com/Lightning-AI/lightning/pull/14657), [#14724](https://github.com/Lightning-AI/lightning/pull/14724))
1515
- Fixed an issue with `TensorBoardLogger.finalize` creating a new experiment when none was created during the Trainer's execution ([#14762](https://github.com/Lightning-AI/lightning/pull/14762))
16+
- Fixed `TypeError` on import when `torch.distributed` is not available ([#14809](https://github.com/Lightning-AI/lightning/pull/14809))
1617

1718

1819
## [1.7.6] - 2022-09-13

src/pytorch_lightning/utilities/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
if torch.distributed.is_available():
3232
from torch._C._distributed_c10d import ProcessGroup
3333
else:
34-
ProcessGroup = ... # type: ignore[assignment,misc]
34+
ProcessGroup = Any # type: ignore[assignment,misc]
3535

3636
_NUMBER = Union[int, float]
3737
_METRIC = Union[Metric, Tensor, _NUMBER]

0 commit comments

Comments
 (0)