Update basicsr/archs/mair_arch.py
Browse files
basicsr/archs/mair_arch.py
CHANGED
@@ -7,7 +7,12 @@ import torch.nn.functional as F
|
|
7 |
from functools import partial
|
8 |
from typing import Optional, Callable
|
9 |
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
11 |
from einops import rearrange, repeat
|
12 |
import time
|
13 |
import sys
|
|
|
7 |
from functools import partial
|
8 |
from typing import Optional, Callable
|
9 |
from timm.models.layers import DropPath, to_2tuple, trunc_normal_
|
10 |
+
try:
|
11 |
+
from mamba_ssm.ops.selective_scan_interface import selective_scan_fn, selective_scan_ref
|
12 |
+
except Exception:
|
13 |
+
# CPU fallback (slow)
|
14 |
+
from mamba_cpu_fallback.selective_scan_interface import selective_scan_ref
|
15 |
+
selective_scan_fn = selective_scan_ref
|
16 |
from einops import rearrange, repeat
|
17 |
import time
|
18 |
import sys
|