Export nn.Module to hbir model.
Parameters:
model (Module) – Input model.
example_inputs (Any) – Example input for tracing.
name (str) – The name of func in exported module. Users can get the func by getattr(hbir_module, name).
input_names (Optional[Any]) – Set hbir inputs with given names, should have the same structure with example_inputs.
output_names (Optional[Any]) – Set hbir outputs with given names, should have the same structure with model output.
input_descs (Optional[Any]) – Set hbir inputs with given descriptions, should have the same structure with example_inputs.
output_descs (Optional[Any]) – Set hbir outputs with given descriptions, should have the same structure with model output.
native_pytree (bool) –
Whether use native pytree support provided by hbdk4. Assume the model input is passed to torch model as:
When using hbdk4 pytree, the hbir model can be called as:
When using plugin pytree, the hbir model can be called as:
Return type: Module
Returns: Hbir model wrapped with Module.