Skip to content

Commit

Permalink
only import 'alt_cuda_corr' when 'AlternateCorrBlock' is used
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rauch committed Oct 11, 2021
1 parent c78cf64 commit 7f3f4f3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions core/corr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
import torch.nn.functional as F
from utils.utils import bilinear_sampler, coords_grid

try:
import alt_cuda_corr
except:
# alt_cuda_corr is not compiled
pass


class CorrBlock:
def __init__(self, fmap1, fmap2, num_levels=4, radius=4):
Expand Down Expand Up @@ -62,6 +56,9 @@ def corr(fmap1, fmap2):

class AlternateCorrBlock:
def __init__(self, fmap1, fmap2, num_levels=4, radius=4):
import alt_cuda_corr
self.alt_corr_fwd = alt_cuda_corr.forward

self.num_levels = num_levels
self.radius = radius

Expand Down

0 comments on commit 7f3f4f3

Please sign in to comment.