hmct.api.build_model
Interface Description
The model conversion function provided by HMCT, inputs an onnx model and outputs the quantized model after model conversion and quantization.
Interface Form
Return Value
Output a quantized onnx model that can be used for quantized model accuracy evaluation, as well as compiled into a deployment model via hbdk.
Parameter
| Parameter | Type | Description | |
| onnx_model | ModelProto | Required, no default value | The input onnx model. |
| march | str | Required, no default value | Computing platform. |
| cali_data | Union[Sequence[np.ndarray], Dict[str, Sequence[np.ndarray]]] | Required, no default value | Calibration data:
|
| quant_config | Optional[Union[str, Dict[str, Any]]] | None | Specify quantized configuration parameters, detailed quantized parameter configuration description reference The quant_config Introduction。
|
| input_dict | Optional[Dict[str, Any]] | None | Modify the converted model inputs according to the specified parameters. Note: The caller needs to ensure that the modifications to the model inputs are legal.
|
| name_prefix | Optional[str] | None | Specify the save path for the generated object during the model conversion process.
|
| verbose | Optional[bool] | True | verbose=True/False, specify whether detailed information is printed during the model conversion. |
