hmct.api.check_model

Interface Description

The quick check function for the conversion process of the model is provided by HMCT, where the input onnx model is checked with some random quantization parameters to see if the model conversion and the process is successful.

Interface Form

def check_model( onnx_model: ModelProto, march: str, input_dict: Optional[Dict[str, Any]] = None, ) -> ModelProto

Return Value

Generate an onnx model with stochastic parameter quantization.

Parameter

The value ranges and definitions of the same parameters in check_model as in build_model are identical.

ParameterTypeDefault ValueDescription
onnx_modelModelProtoRequired, no default valueThe input onnx model.
marchstrRequired, no default valueComputing platform.
input_dictOptional[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.

  1. Modify the input_shape of the specified input:
  2. input_dict = {'input_name0': {'input_shape':[x,x,x,x]}}
  3. Modify the batch_size of the specified input:
  4. input_dict = {'input_name0': {'input_batch': 4}}