-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor model export part 2: Add a dedicated forward function for model export #3317
Refactor model export part 2: Add a dedicated forward function for model export #3317
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3317 +/- ##
===========================================
- Coverage 77.15% 76.19% -0.97%
===========================================
Files 204 194 -10
Lines 17526 16688 -838
===========================================
- Hits 13523 12715 -808
+ Misses 4003 3973 -30
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f3d6070
to
eb1a773
Compare
Signed-off-by: Kim, Vinnam <[email protected]>
Signed-off-by: Kim, Vinnam <[email protected]>
Signed-off-by: Kim, Vinnam <[email protected]>
Signed-off-by: Kim, Vinnam <[email protected]>
…forward-func Signed-off-by: Kim, Vinnam <[email protected]>
Signed-off-by: Kim, Vinnam <[email protected]>
Summary
OTXModelExporter
internally traced theOTXModel.model.forward
function (notOTXModel.forward
). This function needed to have a function signature such asCallable[[torch.Tensor], torch.Tensor | dict[str, torch.Tensor]]
to correctly trace the model. Additionally, the auxiliary functions_reset_model_forward()
and_restore_model_forward()
were required to export an explainable model.OTXModel.forward_for_tracing()
, has been explicitly added. Any derived model that wants to useOTXNativeModelExporter
for its model export can implement this function.How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.