Skip to content

Commit

Permalink
export.py automatic forward_export (#6352)
Browse files Browse the repository at this point in the history
* `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>
  • Loading branch information
glenn-jocher and pre-commit-ci[bot] committed Jan 19, 2022
1 parent e521909 commit 750c42e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1099,4 +1099,4 @@
"outputs": []
}
]
}
}

0 comments on commit 750c42e

Please sign in to comment.