Commit a5fbe71
Refactor Export for Model Conversion and Saving (#7934)
Fixes #6375 .
### Description
Changes to be made based on the [previous discussion
#7835](#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 <popsmall212@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>1 parent de2a819 commit a5fbe71
1 file changed
Lines changed: 29 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1254 | 1255 | | |
1255 | 1256 | | |
1256 | 1257 | | |
| 1258 | + | |
1257 | 1259 | | |
1258 | 1260 | | |
1259 | 1261 | | |
| |||
1268 | 1270 | | |
1269 | 1271 | | |
1270 | 1272 | | |
| 1273 | + | |
| 1274 | + | |
1271 | 1275 | | |
1272 | 1276 | | |
1273 | 1277 | | |
| |||
1307 | 1311 | | |
1308 | 1312 | | |
1309 | 1313 | | |
1310 | | - | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
1314 | | - | |
1315 | | - | |
1316 | | - | |
1317 | | - | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1318 | 1317 | | |
1319 | 1318 | | |
1320 | 1319 | | |
| |||
1413 | 1412 | | |
1414 | 1413 | | |
1415 | 1414 | | |
1416 | | - | |
1417 | | - | |
1418 | | - | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
1422 | | - | |
1423 | 1415 | | |
1424 | 1416 | | |
1425 | | - | |
1426 | | - | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
1427 | 1432 | | |
1428 | 1433 | | |
1429 | 1434 | | |
| |||
1544 | 1549 | | |
1545 | 1550 | | |
1546 | 1551 | | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
1547 | 1555 | | |
1548 | 1556 | | |
| 1557 | + | |
1549 | 1558 | | |
1550 | 1559 | | |
1551 | 1560 | | |
| |||
1715 | 1724 | | |
1716 | 1725 | | |
1717 | 1726 | | |
| 1727 | + | |
| 1728 | + | |
1718 | 1729 | | |
1719 | 1730 | | |
| 1731 | + | |
1720 | 1732 | | |
1721 | 1733 | | |
1722 | 1734 | | |
| |||
0 commit comments