Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Export for Model Conversion and Saving (Project-MONAI#7934)
Fixes Project-MONAI#6375 . ### Description Changes to be made based on the [previous discussion Project-MONAI#7835](Project-MONAI#7835). Modify the `_export` function to call the `saver` parameter for saving different models. Rewrite the `onnx_export` function using the updated `_export` to achieve consistency in model format conversion and saving. * Rewrite `onnx_export` to call `_export` with `convert_to_onnx` and appropriate `kwargs`. * Add a `saver: Callable` parameter to `_export`, replacing `save_net_with_metadata`. * Pass `save_net_with_metadata` function wrapped with `partial` to set parameters like `include_config_vals` and `append_timestamp`. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. --------- Signed-off-by: Han123su <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Eric Kerfoot <[email protected]> Co-authored-by: YunLiu <[email protected]>
- Loading branch information