class_docstr: Quantize weights while preserve sparsity.
class_docstr_tok: ["Quantize","weights","while","preserve","sparsity","."]
docstr: Initializes PrunePreserveDefaultWeightsQuantizer.
  
  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.
docstr_tok: ["Initializes","PrunePreserveDefaultWeightsQuantizer",".","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","."]
code: def __init__(self, num_bits, per_axis, symmetric, narrow_range):
      """Initializes PrunePreserveDefaultWeightsQuantizer.
  
      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.
      """
      quantizers.LastValueQuantizer.__init__(
          self, num_bits, per_axis, symmetric, narrow_range
      )
  
imports: import tensorflow
  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 PrunePreserveDefaultWeightsQuantizer object from inherited base classes: quantizers with example: obj = PrunePreserveDefaultWeightsQuantizer(num_bits, per_axis, symmetric, narrow_range)