class_docstr: Quantize weights while preserving clusters.
docstr: ClusterPreserveDefaultWeightsQuantizer.
  
  Args:
    num_bits: Number of bits for quantization
    per_axis: Whether to apply per_axis quantization. The last dimension is
      used as the axis.
    symmetric: If true, use symmetric quantization limits instead of training
      the minimum and maximum of each quantization range separately.
    narrow_range: In case of 8 bits, narrow_range nudges the quantized range
      to be [-127, 127] instead of [-128, 127]. This ensures symmetric
      range has 0 as the centre.
    preserve_sparsity: Whether to apply prune-cluster-preserving quantization
      aware training.
code: def __init__(
      self,
      num_bits,
      per_axis,
      symmetric,
      narrow_range,
      preserve_sparsity,
  ):
      """ClusterPreserveDefaultWeightsQuantizer.
  
      Args:
        num_bits: Number of bits for quantization
        per_axis: Whether to apply per_axis quantization. The last dimension is
          used as the axis.
        symmetric: If true, use symmetric quantization limits instead of training
          the minimum and maximum of each quantization range separately.
        narrow_range: In case of 8 bits, narrow_range nudges the quantized range
          to be [-127, 127] instead of [-128, 127]. This ensures symmetric
          range has 0 as the centre.
        preserve_sparsity: Whether to apply prune-cluster-preserving quantization
          aware training.
      """
      super(ClusterPreserveDefaultWeightsQuantizer, self).__init__(
          num_bits=num_bits,
          per_axis=per_axis,
          symmetric=symmetric,
          narrow_range=narrow_range,
      )
      self.preserve_sparsity = preserve_sparsity
  
imports: import logging
  import warnings
  import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import cluster_config
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_registry
  from tensorflow_model_optimization.python.core.quantization.keras import quant_ops
  from tensorflow_model_optimization.python.core.quantization.keras import quantizers
  from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_quantize_registry
  from tensorflow_model_optimization.python.core.quantization.keras.default_8bit import default_8bit_quantizers
label_desc: Use image node_id 1 to create a new ClusterPreserveDefaultWeightsQuantizer object from inherited base classes: quantizers with example: obj = ClusterPreserveDefaultWeightsQuantizer(num_bits, per_axis, symmetric, narrow_range, preserve_sparsity)