Skip to content

Commit 7f3f4f3

Browse files
only import 'alt_cuda_corr' when 'AlternateCorrBlock' is used
1 parent c78cf64 commit 7f3f4f3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/corr.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
import torch.nn.functional as F
33
from utils.utils import bilinear_sampler, coords_grid
44

5-
try:
6-
import alt_cuda_corr
7-
except:
8-
# alt_cuda_corr is not compiled
9-
pass
10-
115

126
class CorrBlock:
137
def __init__(self, fmap1, fmap2, num_levels=4, radius=4):
@@ -62,6 +56,9 @@ def corr(fmap1, fmap2):
6256

6357
class AlternateCorrBlock:
6458
def __init__(self, fmap1, fmap2, num_levels=4, radius=4):
59+
import alt_cuda_corr
60+
self.alt_corr_fwd = alt_cuda_corr.forward
61+
6562
self.num_levels = num_levels
6663
self.radius = radius
6764

0 commit comments

Comments
 (0)