export.py automatic forward_export (#6352)

* `export.py` automatic `forward_export`

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Glenn Jocherandpre-commit-ci[bot] authored and GitHub committed 2022-01-19 12:24:40 -10:00
1 parent e5219099cd
commit 750c42e43e
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -427,7 +427,8 @@ def run(data=ROOT / 'data/coco128.yaml', # 'dataset.yaml path'
elif isinstance(m, Detect):
m.inplace = inplace
m.onnx_dynamic = dynamic
# m.forward = m.forward_export # assign forward (optional)
if hasattr(m, 'forward_export'):
m.forward = m.forward_export # assign custom forward (optional)
for _ in range(2):
y = model(im) # dry runs
+1 -1
View File
@@ -1099,4 +1099,4 @@
"outputs": []
}
]
}
}