update: 适配昇腾
Some checks failed
Ultralytics CI / HUB (ubuntu-latest, 3.11) (push) Has been cancelled
Ultralytics CI / Benchmarks (yolo11n, macos-15, 3.11) (push) Has been cancelled
Ultralytics CI / Benchmarks (yolo11n, ubuntu-latest, 3.11) (push) Has been cancelled
Ultralytics CI / Tests (macos-15, 3.11, latest) (push) Has been cancelled
Ultralytics CI / Tests (ubuntu-latest, 3.11, latest) (push) Has been cancelled
Ultralytics CI / Tests (ubuntu-latest, 3.8, 1.8.0) (push) Has been cancelled
Ultralytics CI / Tests (windows-latest, 3.11, latest) (push) Has been cancelled
Ultralytics CI / GPU (push) Has been cancelled
Ultralytics CI / RaspberryPi (push) Has been cancelled
Ultralytics CI / Conda (ubuntu-latest, 3.11) (push) Has been cancelled
Ultralytics CI / Summary (push) Has been cancelled
Publish Docker Images / Push (push) Has been cancelled
Publish Docker Images / Push-1 (push) Has been cancelled
Publish Docker Images / Push-2 (push) Has been cancelled
Publish Docker Images / Push-3 (push) Has been cancelled
Publish Docker Images / Push-4 (push) Has been cancelled
Publish Docker Images / Push-5 (push) Has been cancelled
Publish Docker Images / Push-6 (push) Has been cancelled
Publish Docker Images / trigger-actions (push) Has been cancelled
Publish Docker Images / notify (push) Has been cancelled
Publish Docs / Docs (push) Has been cancelled
Publish to PyPI / check (push) Has been cancelled
Publish to PyPI / build (push) Has been cancelled
Publish to PyPI / publish (push) Has been cancelled
Publish to PyPI / notify (push) Has been cancelled

This commit is contained in:
Kare-Udon 2025-11-27 09:57:34 +00:00 committed by GitHub
parent e74b035c02
commit 696c1b0793
5 changed files with 34 additions and 11 deletions

View file

@ -185,7 +185,10 @@ class SPPF(nn.Module):
def forward(self, x):
"""Forward pass through Ghost Convolution block."""
y = [self.cv1(x)]
y.extend(self.m(y[-1]) for _ in range(3))
# y.extend(self.m(y[-1]) for _ in range(3))
for _ in range(3):
o1 = self.m(y[-1])
y.extend(o1.unsqueeze(0))
return self.cv2(torch.cat(y, 1))
@ -236,7 +239,11 @@ 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)
# y.extend(m(y[-1]) for m in self.m)
# 该条代码在torch和dynamo中存在逻辑分歧改为外部循环表示
for m in self.m:
o1 = m(y[-1])
y.extend(o1.unsqueeze(0))
return self.cv2(torch.cat(y, 1))
def forward_split(self, x):