quantization.hbdk4.export
horizon_plugin_pytorch.quantization.hbdk4.export(model: Module, example_inputs: Any, *, name: str = 'forward', input_names: Any | None = None, output_names: Any | None = None, input_descs: Any | None = None, output_descs: Any | None = None)
Export nn.Module to hbir model.
- Parameters:
- model – Input model.
- example_inputs – Example input for tracing.
- name – The name of func in exported module.
Users can get the func by getattr(hbir_module, name).
- input_names – Set hbir inputs with given names, should have the same
structure with example_inputs.
- output_names – Set hbir outputs with given names, should have the same
structure with model output.
- input_descs – Set hbir inputs with given descriptions, should have the same
structure with example_inputs.
- output_descs – Set hbir outputs with given descriptions, should have the same
structure with model output.
- Returns:
Hbir model wrapped with Module.