def get_qconfig_mapping_from_quantization_config(
        self,
        model: _nn.Module,
        quantization_config: _LinearQuantizerConfig,
        quantization_scheme: _QuantizationScheme,
    ) -> _aoquant.QConfigMapping:
        """
        Builds py:class:`QConfigMapping` from :py:class:`LinearQuantizerConfig`.
        """
        qconfig = (
            self._create_qconfig_from_quantization_config(quantization_config.global_config)
            if quantization_config.global_config is not None
            else None
        )

        qconfig_mapping = self.get_default_qconfig_mapping(
            quantization_scheme=quantization_scheme,
            quantization_config=quantization_config.global_config,
            qconfig=qconfig,
        )

        for mod_type, config in quantization_config.module_type_configs.items():
            qconfig = (
                self._create_qconfig_from_quantization_config(config)
                if config is not None
                else config
            )
            qconfig = (
                self._adjust_qconfig_for_module_type(mod_type, qconfig, config)
                if qconfig is not None
                else qconfig
            )
            qconfig_mapping = qconfig_mapping.set_object_type(mod_type, qconfig)
        for mod_name, config in quantization_config.module_name_configs.items():
            qconfig = (
                self._create_qconfig_from_quantization_config(config)
                if config is not None
                else config
            )
            try:
                submod = model.get_submodule(mod_name)
                qconfig = (
                    self._adjust_qconfig_for_module_type(type(submod), qconfig, config)
                    if qconfig is not None
                    else qconfig
                )
            except AttributeError:
                _logger.warning(
                    f"Could not find a submodule with name {mod_name}. "
                    f"If the name corresponded to something other than a module, "
                    f"this message can be ignored. Otherwise, it's possible "
                    f"the module name was not correctly specified in the config."
                )

            mod_names = self._get_module_names_for_setting_qconfig(model, mod_name)
            for mn in mod_names:
                qconfig_mapping = qconfig_mapping.set_module_name(mn, qconfig)
        return qconfig_mapping

        Builds py:class:`QConfigMapping` from :py:class:`LinearQuantizerConfig`.
        
coremltools/optimize/torch/quantization/_qconfig_mapping.py