code: def get_default_x86_inductor_quantization_config(
      is_qat: bool = False,
      is_dynamic: bool = False,
  ):
      extra_args: Dict[str, Any] = {"eps": 2**-12}
      if is_qat:
          if is_dynamic:
              act_observer_or_fake_quant_ctr = FakeQuantize
              dynamic_quant_observer = (
                  MovingAverageMinMaxObserver.with_args(
                      averaging_constant=1
                  )
              )
              extra_args["observer"] = dynamic_quant_observer
          else:
              act_observer_or_fake_quant_ctr = FusedMovingAvgObsFakeQuantize  # type: ignore[assignment]
      else:
          if is_dynamic:
              act_observer_or_fake_quant_ctr = PlaceholderObserver  # type: ignore[assignment]
          else:
              act_observer_or_fake_quant_ctr = HistogramObserver  # type: ignore[assignment]
  
      # Copy from x86 default qconfig from torch/ao/quantization/qconfig.py
      act_quantization_spec = QuantizationSpec(
          dtype=torch.uint8,
          quant_min=0,
          quant_max=255,  # reduce_range=False
          qscheme=torch.per_tensor_affine,
          is_dynamic=is_dynamic,
          observer_or_fake_quant_ctr=act_observer_or_fake_quant_ctr.with_args(
              **extra_args
          ),
      )
  
      weight_observer_or_fake_quant_ctr: _ObserverOrFakeQuantizeConstructor = (
          FusedMovingAvgObsFakeQuantize
          if is_qat
          else PerChannelMinMaxObserver
      )
  
      if is_qat:
          # Only support per channel quant for now
          extra_args["observer"] = MovingAveragePerChannelMinMaxObserver  # type: ignore[dict-item]
      weight_quantization_spec = QuantizationSpec(
          dtype=torch.int8,
          quant_min=-128,
          quant_max=127,
          qscheme=torch.per_channel_symmetric,
          ch_axis=0,  # 0 corresponding to weight shape = (oc, ic, kh, kw) of conv
          is_dynamic=False,
          observer_or_fake_quant_ctr=weight_observer_or_fake_quant_ctr.with_args(
              **extra_args
          ),
      )
      bias_quantization_spec = (
          None  # will use placeholder observer by default
      )
      quantization_config = QuantizationConfig(
          act_quantization_spec,
          act_quantization_spec,
          weight_quantization_spec,
          bias_quantization_spec,
          is_qat,
      )
      return quantization_config
  
imports: import copy
  import functools
  import itertools
  import operator
  from dataclasses import dataclass
  from typing import Any, Dict, List, Optional, Sequence, Set, Tuple
  import torch
  import torch.nn.functional
  from torch.ao.quantization.fake_quantize import FakeQuantize, FusedMovingAvgObsFakeQuantize
  from torch.ao.quantization.observer import HistogramObserver, MovingAverageMinMaxObserver, MovingAveragePerChannelMinMaxObserver, PerChannelMinMaxObserver, PlaceholderObserver
  from torch.ao.quantization.pt2e.graph_utils import find_sequential_partitions
  from torch.ao.quantization.qconfig import _ObserverOrFakeQuantizeConstructor
  from torch.ao.quantization.quantizer.quantizer import QuantizationAnnotation, QuantizationSpec, Quantizer, SharedQuantizationSpec
  from torch.ao.quantization.quantizer.xnnpack_quantizer_utils import _is_annotated, get_bias_qspec, get_input_act_qspec, get_output_act_qspec, get_weight_qspec, OperatorConfig, OperatorPatternType, QuantizationConfig
  from torch.fx import Node
  from torch.fx.passes.utils.source_matcher_utils import get_source_partitions, SourcePartition
label_desc: Use image node_id 8 for calling a global function with example usage: get_default_x86_inductor_quantization_config(is_qat, is_dynamic) and returns: quantization_config