Skip to content

Commit 3da62ff

Browse files
authored
Proper check for availability of bagua (#15220)
1 parent 90e1a0e commit 3da62ff

File tree

1 file changed

+2
-2
lines changed
  • src/pytorch_lightning/strategies

1 file changed

+2
-2
lines changed

src/pytorch_lightning/strategies/bagua.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from typing import Any, Dict, List, Optional, Union
1717

1818
import torch
19-
from lightning_utilities.core.imports import package_available
19+
from lightning_utilities.core.imports import module_available
2020
from torch import Tensor
2121
from torch.nn import Module
2222

@@ -32,7 +32,7 @@
3232
from pytorch_lightning.trainer.states import TrainerFn
3333
from pytorch_lightning.utilities.exceptions import MisconfigurationException
3434

35-
_BAGUA_AVAILABLE = package_available("bagua")
35+
_BAGUA_AVAILABLE = module_available("bagua.torch_api")
3636

3737
if _BAGUA_AVAILABLE:
3838
import bagua.torch_api as bagua

0 commit comments

Comments
 (0)