summaryrefslogtreecommitdiff
path: root/models/layers.py
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2021-03-12 13:59:18 +0800
committerJordan Gong <jordan.gong@protonmail.com>2021-03-12 13:59:18 +0800
commit2a7d3c04eab1f3c2e5306d1597399582229a87e5 (patch)
tree060bbd3d0b9d1f3823219225097fb4d74eb311fe /models/layers.py
parent39fb3e19601aaccd572ea023b117543b9d791b56 (diff)
parentd63b267dd15388dd323d9b8672cdb9461b96c885 (diff)
Merge branch 'python3.8' into python3.7
# Conflicts: # utils/configuration.py
Diffstat (limited to 'models/layers.py')
-rw-r--r--models/layers.py9
1 files changed, 0 insertions, 9 deletions
diff --git a/models/layers.py b/models/layers.py
index e30d0c4..a0933e8 100644
--- a/models/layers.py
+++ b/models/layers.py
@@ -167,17 +167,10 @@ class BasicConv1d(nn.Module):
class HorizontalPyramidPooling(nn.Module):
def __init__(
self,
- in_channels: int,
- out_channels: int,
- use_1x1conv: bool = False,
use_avg_pool: bool = True,
use_max_pool: bool = False,
- **kwargs
):
super().__init__()
- self.use_1x1conv = use_1x1conv
- if use_1x1conv:
- self.conv = BasicConv2d(in_channels, out_channels, 1, **kwargs)
self.use_avg_pool = use_avg_pool
self.use_max_pool = use_max_pool
assert use_avg_pool or use_max_pool, 'Pooling layer(s) required.'
@@ -191,6 +184,4 @@ class HorizontalPyramidPooling(nn.Module):
x = self.avg_pool(x)
elif not self.use_avg_pool and self.use_max_pool:
x = self.max_pool(x)
- if self.use_1x1conv:
- x = self.conv(x)
return x