Browse Source
`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>
modifyDataloader
Glenn Jocher
GitHub
2 years ago
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
2 deletions
-
export.py
-
tutorial.ipynb
|
|
|
|
|
|
|
|
elif isinstance(m, Detect): |
|
|
elif isinstance(m, Detect): |
|
|
m.inplace = inplace |
|
|
m.inplace = inplace |
|
|
m.onnx_dynamic = dynamic |
|
|
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): |
|
|
for _ in range(2): |
|
|
y = model(im) # dry runs |
|
|
y = model(im) # dry runs |
|
|
|
|
|
|
|
|
"outputs": [] |
|
|
"outputs": [] |
|
|
} |
|
|
} |
|
|
] |
|
|
] |
|
|
} |
|
|
|
|
|
|
|
|
} |