class_docstr: PrunePreserveQuantizeRegistry responsible for built-in keras layers.
class_docstr_tok: ["PrunePreserveQuantizeRegistry","responsible","for","built-in","keras","layers","."]
docstr: Applies weights sparsity preservation.
  
  Args:
    layer: The layer to check for support.
    quantize_config: quantization config to check for support,
      apply sparsity preservation to pruned weights
  Raises:
    ValueError when layer is supported does not have quantization config.
  Returns:
    Returns quantize_config with addon sparsity preserve weight_quantizer.
docstr_tok: ["Applies","weights","sparsity","preservation",".","Args",":","layer",":","The","layer","to","check","for","support",".","quantize_config",":","quantization","config","to","check","for","support",",","apply","sparsity","preservation","to","pruned","weights","Raises",":","ValueError","when","layer","is","supported","does","not","have","quantization","config",".","Returns",":","Returns","quantize_config","with","addon","sparsity","preserve","weight_quantizer","."]
code: def apply_sparsity_preserve_quantize_config(
      self, layer, quantize_config
  ):
      """Applies weights sparsity preservation.
  
      Args:
        layer: The layer to check for support.
        quantize_config: quantization config to check for support,
          apply sparsity preservation to pruned weights
      Raises:
        ValueError when layer is supported does not have quantization config.
      Returns:
        Returns quantize_config with addon sparsity preserve weight_quantizer.
      """
      if self.supports(layer):
          if self._no_trainable_weights(
              layer
          ) or self._disable_prune_preserve(layer):
              return quantize_config
          if (
              quantize_config.__class__.__name__
              in self._LAYERS_CONFIG_MAP[
                  layer.__class__
              ].quantize_config_attrs
          ):
              quantize_config.weight_quantizer = (
                  self._config_quantizer_map[
                      quantize_config.__class__.__name__
                  ]
              )
          else:
              raise ValueError(
                  "Configuration {} is not supported for Layer {}.".format(
                      str(quantize_config.__class__.__name__),
                      str(layer.__class__.__name__),
                  )
              )
      else:
          raise ValueError(
              "Layer {} is not supported.".format(
                  str(layer.__class__.__name__)
              )
          )
  
      return quantize_config
  
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 8 for calling the PrunePreserveQuantizeRegistry obj's underlying member method code with example usage: obj.apply_sparsity_preserve_quantize_config(layer, quantize_config) and returns: quantize_config, quantize_config