Skip to content

Commit 90a7cfb

Browse files
committed
[Misc.] Add TYPE_CHECKING to avoid circular imports
1 parent 76e25e6 commit 90a7cfb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fla/utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@
99
import warnings
1010
from enum import Enum
1111
from functools import lru_cache
12-
from typing import Any, Callable, Dict, Literal, Optional, Tuple
12+
from typing import TYPE_CHECKING, Any, Callable, Dict, Literal, Optional, Tuple
1313

1414
import torch
1515
import triton
1616
from packaging import version
1717

18-
from fla import __version__
19-
2018
logger = logging.getLogger(__name__)
2119

20+
if TYPE_CHECKING:
21+
from fla import __version__
22+
2223
COMPILER_MODE = os.getenv("FLA_COMPILER_MODE") == "1"
2324
FLA_CI_ENV = os.getenv("FLA_CI_ENV") == "1"
2425

0 commit comments

Comments
 (0)