Skip to content
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

Make the _export function support saver input #6375

Closed
binliunls opened this issue Apr 17, 2023 · 0 comments · Fixed by #7934
Closed

Make the _export function support saver input #6375

binliunls opened this issue Apr 17, 2023 · 0 comments · Fixed by #7934
Labels
enhancement New feature or request Feature request

Comments

@binliunls
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The _export function in the bundle script is for converting models from one format to another one, e.g. converting a pytorch model to a torchscript model. It takes a converter and a model as inputs, converts the given model with the converter and save the converted model to a given path.

However, the saving logic in the _export function just suits to save the torchscript model. Given a converter which exports a torchsciprt model to an onnx model, this logic would fail to save the model. To make the _export function more general, a saver which takes model, savepath, extra_kwargs, should be passed to it instead of the current saving logic.

Describe the solution you'd like
Add a saver to the input parameters of the _export function.
Replace the current saving logic in the _export function with a call of the saver.
Use the _export function to rewrite the onnx_export function.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature request
Projects
None yet
2 participants