Refactor Python code (#13448)
Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com> Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
parent
6a234f3639
commit
1b26838def
22 changed files with 81 additions and 101 deletions
|
|
@ -666,8 +666,7 @@ class CBLinear(nn.Module):
|
|||
|
||||
def forward(self, x):
|
||||
"""Forward pass through CBLinear layer."""
|
||||
outs = self.conv(x).split(self.c2s, dim=1)
|
||||
return outs
|
||||
return self.conv(x).split(self.c2s, dim=1)
|
||||
|
||||
|
||||
class CBFuse(nn.Module):
|
||||
|
|
@ -682,5 +681,4 @@ class CBFuse(nn.Module):
|
|||
"""Forward pass through CBFuse layer."""
|
||||
target_size = xs[-1].shape[2:]
|
||||
res = [F.interpolate(x[self.idx[i]], size=target_size, mode="nearest") for i, x in enumerate(xs[:-1])]
|
||||
out = torch.sum(torch.stack(res + xs[-1:]), dim=0)
|
||||
return out
|
||||
return torch.sum(torch.stack(res + xs[-1:]), dim=0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue