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.
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
_exportfunction 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_exportfunction more general, a saver which takesmodel, savepath, extra_kwargs, should be passed to it instead of the current saving logic.Describe the solution you'd like
Add a
saverto the input parameters of the_exportfunction.Replace the current saving logic in the
_exportfunction with a call of thesaver.Use the
_exportfunction to rewrite theonnx_exportfunction.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.