def save_quantized_model(self, model, path, input_spec=None, **config):
    "\n        Save the quantized model for the inference.\n\n        Args:\n            model (Layer): The model to be saved.\n            path (str): The path prefix to save model. The format is \n                ``dirname/file_prefix`` or ``file_prefix``.\n            input_spec (list[InputSpec|Tensor], optional): Describes the input\n                of the saved model's forward method, which can be described by\n                InputSpec or example Tensor. If None, all input variables of \n                the original Layer's forward method would be the inputs of\n                the saved model. Default None.\n            **configs (dict, optional): Other save configuration options for\n                compatibility. We do not recommend using these configurations,\n                they may be removed in the future. If not necessary, DO NOT use\n                them. Default None.\n                The following options are currently supported:\n                (1) output_spec (list[Tensor]): Selects the output targets of\n                the saved model. By default, all return variables of original\n                Layer's forward method are kept as the output of the saved model.\n                If the provided ``output_spec`` list is not all output variables, \n                the saved model will be pruned according to the given\n                ``output_spec`` list. \n\n        Returns:\n            None\n        "
    assert isinstance(model, dygraph.Layer), 'The model must be the instance of dygraph.Layer.'
    paddle.jit.save(layer=model, path=path, input_spec=input_spec, **config)
    is_dynamic_mode = False
    if paddle.in_dynamic_mode():
        is_dynamic_mode = True
        paddle.enable_static()
    place = core.CPUPlace()
    scope = global_scope()
    exe = Executor(place)
    dirname = os.path.dirname(path)
    basename = os.path.basename(path)
    model_filename = (basename + INFER_MODEL_SUFFIX)
    params_filename = (basename + INFER_PARAMS_SUFFIX)
    [infer_program, feed_target_names, fetch_targets] = load_inference_model(dirname=dirname, executor=exe, model_filename=model_filename, params_filename=params_filename)
    self._gather_scales(infer_program, scope)
    self._set_skip_quant_attr(infer_program)
    save_inference_model(dirname=dirname, feeded_var_names=feed_target_names, target_vars=fetch_targets, executor=exe, main_program=infer_program.clone(), model_filename=model_filename, params_filename=params_filename)
    if is_dynamic_mode:
        paddle.disable_static()
Save the quantized model for the inference.

Args:
    model (Layer): The model to be saved.
    path (str): The path prefix to save model. The format is 
        ``dirname/file_prefix`` or ``file_prefix``.
    input_spec (list[InputSpec|Tensor], optional): Describes the input
        of the saved model's forward method, which can be described by
        InputSpec or example Tensor. If None, all input variables of 
        the original Layer's forward method would be the inputs of
        the saved model. Default None.
    **configs (dict, optional): Other save configuration options for
        compatibility. We do not recommend using these configurations,
        they may be removed in the future. If not necessary, DO NOT use
        them. Default None.
        The following options are currently supported:
        (1) output_spec (list[Tensor]): Selects the output targets of
        the saved model. By default, all return variables of original
        Layer's forward method are kept as the output of the saved model.
        If the provided ``output_spec`` list is not all output variables, 
        the saved model will be pruned according to the given
        ``output_spec`` list. 

Returns:
    None
def save_quantized_model(self, model, path, input_spec=None, **config):
    "\n        Save the quantized model for the inference.\n\n        Args:\n            model (Layer): The model to be saved.\n            path (str): The path prefix to save model. The format is \n                ``dirname/file_prefix`` or ``file_prefix``.\n            input_spec (list[InputSpec|Tensor], optional): Describes the input\n                of the saved model's forward method, which can be described by\n                InputSpec or example Tensor. If None, all input variables of \n                the original Layer's forward method would be the inputs of\n                the saved model. Default None.\n            **configs (dict, optional): Other save configuration options for\n                compatibility. We do not recommend using these configurations,\n                they may be removed in the future. If not necessary, DO NOT use\n                them. Default None.\n                The following options are currently supported:\n                (1) output_spec (list[Tensor]): Selects the output targets of\n                the saved model. By default, all return variables of original\n                Layer's forward method are kept as the output of the saved model.\n                If the provided ``output_spec`` list is not all output variables, \n                the saved model will be pruned according to the given\n                ``output_spec`` list. \n\n        Returns:\n            None\n        "
    assert isinstance(model, dygraph.Layer), 'The model must be the instance of dygraph.Layer.'
    paddle.jit.save(layer=model, path=path, input_spec=input_spec, **config)
    is_dynamic_mode = False
    if paddle.in_dynamic_mode():
        is_dynamic_mode = True
        paddle.enable_static()
    place = core.CPUPlace()
    scope = global_scope()
    exe = Executor(place)
    dirname = os.path.dirname(path)
    basename = os.path.basename(path)
    model_filename = (basename + INFER_MODEL_SUFFIX)
    params_filename = (basename + INFER_PARAMS_SUFFIX)
    [infer_program, feed_target_names, fetch_targets] = load_inference_model(dirname=dirname, executor=exe, model_filename=model_filename, params_filename=params_filename)
    self._gather_scales(infer_program, scope)
    self._set_skip_quant_attr(infer_program)
    save_inference_model(dirname=dirname, feeded_var_names=feed_target_names, target_vars=fetch_targets, executor=exe, main_program=infer_program.clone(), model_filename=model_filename, params_filename=params_filename)
    if is_dynamic_mode:
        paddle.disable_static()