Skip to content

Commit 33a5d8f

Browse files
committed
1 parent 948307d commit 33a5d8f

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

escnn/nn/modules/pooling/gaussian_blur.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@
1010

1111
from typing import Optional, Union, Tuple
1212

13-
_CONV = {
14-
2: F.conv2d,
15-
3: F.conv3d,
16-
}
17-
1813
class GaussianBlurND(LazyModuleMixin, Module):
1914

2015
def __init__(
@@ -76,6 +71,7 @@ def __init__(
7671
self.stride = stride
7772
self.edge_correction = edge_correction
7873
self.d = d
74+
self.conv = getattr(F, f'conv{d}d')
7975

8076
if padding is not None:
8177
self.padding = padding
@@ -130,7 +126,7 @@ def forward(self, x):
130126
return y
131127

132128
def blur(self, x):
133-
return _CONV[self.d](
129+
return self.conv(
134130
x,
135131
self.filter,
136132
stride=self.stride,

0 commit comments

Comments
 (0)