class_docstr: Quantize weights while preserve sparsity.
class_docstr_tok: ["Quantize","weights","while","preserve","sparsity","."]
code: def _build_sparsity_mask(self, name, layer):
      weights = getattr(layer.layer, name)
      sparsity_mask = tf.math.divide_no_nan(weights, weights)
  
      return {"sparsity_mask": sparsity_mask}
  
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 2 for calling the PrunePreserveDefaultWeightsQuantizer obj's underlying member method code with example usage: obj._build_sparsity_mask(name, layer) and returns: dict