File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 11
11
12
12
from __future__ import annotations
13
13
14
- import importlib .util
15
14
import math
16
15
from collections .abc import Sequence
17
16
from typing import List
21
20
import torch .nn .functional as F
22
21
23
22
from monai .networks .blocks import Convolution
24
- from monai .utils import ensure_tuple_rep
25
23
26
24
# To install xformers, use pip install xformers==0.0.16rc401
27
- if importlib .util .find_spec ("xformers" ) is not None :
28
- import xformers
29
- import xformers .ops
30
-
31
- has_xformers = True
32
- else :
33
- xformers = None
34
- has_xformers = False
35
-
36
- # TODO: Use MONAI's optional_import
37
- # from monai.utils import optional_import
38
- # xformers, has_xformers = optional_import("xformers.ops", name="xformers")
25
+ from monai .utils import ensure_tuple_rep , optional_import
26
+
27
+ xformers , has_xformers = optional_import ("xformers" )
39
28
40
29
__all__ = ["AutoencoderKL" ]
41
30
You can’t perform that action at this time.
0 commit comments