Fix two regressions

pull/155/head
Ross Wightman 5 years ago
parent a7e8cadd15
commit 4ddde1d3a4

@ -5,7 +5,7 @@ from .create_act import get_act_fn
class SEModule(nn.Module): class SEModule(nn.Module):
def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None, def __init__(self, channels, reduction=16, act_layer=nn.ReLU, min_channels=8, reduction_channels=None,
gate_fn='hard_sigmoid'): gate_fn='sigmoid'):
super(SEModule, self).__init__() super(SEModule, self).__init__()
self.avg_pool = nn.AdaptiveAvgPool2d(1) self.avg_pool = nn.AdaptiveAvgPool2d(1)
reduction_channels = reduction_channels or max(channels // reduction, min_channels) reduction_channels = reduction_channels or max(channels // reduction, min_channels)

@ -99,9 +99,9 @@ class Bottle2neck(nn.Module):
spx = torch.split(out, self.width, 1) spx = torch.split(out, self.width, 1)
spo = [] spo = []
sp = spx[0] sp = spx[0] # redundant, for torchscript
for i, (conv, bn) in enumerate(zip(self.convs, self.bns)): for i, (conv, bn) in enumerate(zip(self.convs, self.bns)):
if self.is_first: if i == 0 or self.is_first:
sp = spx[i] sp = spx[i]
else: else:
sp = sp + spx[i] sp = sp + spx[i]

Loading…
Cancel
Save