Update block.py

mct-2.1.1
Laughing-q 7 months ago
parent 2ef0bdcbc3
commit 6e607a1362
  1. 6
      ultralytics/nn/modules/block.py

@ -235,6 +235,12 @@ class C2f(nn.Module):
def forward(self, x):
"""Forward pass through C2f layer."""
y = list(self.cv1(x).chunk(2, 1))
y.extend(m(y[-1]) for m in self.m)
return self.cv2(torch.cat(y, 1))
def forward_fx(self, x):
"""Forward pass creating list explictly instead of using list()."""
y1 = self.cv1(x).chunk(2, 1)
y = [y1[0], y1[1]]
y.extend(m(y[-1]) for m in self.m)

Loading…
Cancel
Save