Skip to content

Commit a84babe

Browse files
committed
update
1 parent 33342c3 commit a84babe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lightning/pytorch/plugins/io/async_plugin.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
# limitations under the License.
1414

1515
from concurrent.futures import ThreadPoolExecutor
16-
from typing import Any, Optional
16+
from typing import Any, Optional, TYPE_CHECKING
1717

1818
import torch
1919
from lightning_utilities.core.apply_func import apply_to_collection
2020
from typing_extensions import override
2121

2222
from lightning.pytorch.plugins.io.wrapper import _WrappingCheckpointIO
2323

24-
if TYPING_CHE:
24+
if TYPE_CHECKING:
2525
from lightning.fabric.plugins import CheckpointIO
2626

2727

@@ -86,6 +86,7 @@ def teardown(self) -> None:
8686
if self._error:
8787
raise self._error
8888

89+
8990
# snapshot the checkpoint payload on the caller thread to avoid races with parameter mutation
9091
def _clone_tensor(t: torch.Tensor) -> torch.Tensor:
9192
# detach to avoid autograd history and clone to take a point-in-time copy

0 commit comments

Comments
 (0)