updates
This commit is contained in:
parent
2d9bc62526
commit
3cf8a13910
|
@ -141,15 +141,10 @@ class weightedFeatureFusion(nn.Module): # weighted sum of 2 or more layers http
|
||||||
|
|
||||||
# Adjust channels
|
# Adjust channels
|
||||||
if dc > 0: # slice input
|
if dc > 0: # slice input
|
||||||
# a = nn.ZeroPad2d((0, 0, 0, 0, 0, dc))(a)
|
x[:, :ac] = x[:, :ac] + a # or a = nn.ZeroPad2d((0, 0, 0, 0, 0, dc))(a); x = x + a
|
||||||
x[:, :ac] = x[:, :ac] + a
|
|
||||||
elif dc < 0: # slice feature
|
elif dc < 0: # slice feature
|
||||||
if self.n == 2:
|
|
||||||
return x + a[:, :nc]
|
|
||||||
x = x + a[:, :nc]
|
x = x + a[:, :nc]
|
||||||
else: # same shape
|
else: # same shape
|
||||||
if self.n == 2:
|
|
||||||
return x + a
|
|
||||||
x = x + a
|
x = x + a
|
||||||
return x
|
return x
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue