class_docstr: Custom configuration for :func:`~torch.ao.quantization.quantize_fx.convert_fx`.
  
  Example usage::
  
      convert_custom_config = ConvertCustomConfig()             .set_observed_to_quantized_mapping(ObservedCustomModule, QuantizedCustomModule)             .set_preserved_attributes(["attr1", "attr2"])
class_docstr_tok: ["Custom","configuration","for",":","func",":","`","~torch.ao.quantization.quantize_fx.convert_fx","`",".","Example","usage",":",":","convert_custom_config","=","ConvertCustomConfig","(",")",".set_observed_to_quantized_mapping","(","ObservedCustomModule",",","QuantizedCustomModule",")",".set_preserved_attributes","(","[","``","attr1","''",",","``","attr2","''","]",")"]
docstr: Convert this ``ConvertCustomConfig`` to a dictionary with the items described in
  :func:`~torch.ao.quantization.fx.custom_config.ConvertCustomConfig.from_dict`.
docstr_tok: ["Convert","this","``","ConvertCustomConfig","``","to","a","dictionary","with","the","items","described","in",":","func",":","`","~torch.ao.quantization.fx.custom_config.ConvertCustomConfig.from_dict","`","."]
code: def to_dict(self) -> Dict[str, Any]:
      """
      Convert this ``ConvertCustomConfig`` to a dictionary with the items described in
      :func:`~torch.ao.quantization.fx.custom_config.ConvertCustomConfig.from_dict`.
      """
      d: Dict[str, Any] = {}
      for (
          quant_type,
          observed_to_quantized_mapping,
      ) in self.observed_to_quantized_mapping.items():
          if OBSERVED_TO_QUANTIZED_DICT_KEY not in d:
              d[OBSERVED_TO_QUANTIZED_DICT_KEY] = {}
          d[OBSERVED_TO_QUANTIZED_DICT_KEY][
              _get_quant_type_to_str(quant_type)
          ] = observed_to_quantized_mapping
      if len(self.preserved_attributes) > 0:
          d[PRESERVED_ATTRIBUTES_DICT_KEY] = self.preserved_attributes
      return d
  
imports: from __future__ import annotations
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Tuple, Type
  from torch.ao.quantization import QConfigMapping
  from torch.ao.quantization.backend_config import BackendConfig
  from torch.ao.quantization.quant_type import QuantType, _quant_type_from_str, _get_quant_type_to_str
label_desc: Use image node_id 6 for calling the ConvertCustomConfig obj's underlying member method code with example usage: obj.to_dict() and returns: d