class_docstr: Quantize weights while preserve sparsity.
class_docstr_tok: ["Quantize","weights","while","preserve","sparsity","."]
docstr: Constructs mask to preserve weights sparsity.
  
  Args:
    tensor_shape: Shape of weights which needs to be quantized.
    name: Name of weights in layer.
    layer: quantization wrapped keras layer.
  
  Returns:
    Dictionary of constructed sparsity mask and
    quantization params, the dictionary will be passed
    to __call__ function.
docstr_tok: ["Constructs","mask","to","preserve","weights","sparsity",".","Args",":","tensor_shape",":","Shape","of","weights","which","needs","to","be","quantized",".","name",":","Name","of","weights","in","layer",".","layer",":","quantization","wrapped","keras","layer",".","Returns",":","Dictionary","of","constructed","sparsity","mask","and","quantization","params",",","the","dictionary","will","be","passed","to","__call__","function","."]
code: def build(self, tensor_shape, name, layer):
      """Constructs mask to preserve weights sparsity.
  
      Args:
        tensor_shape: Shape of weights which needs to be quantized.
        name: Name of weights in layer.
        layer: quantization wrapped keras layer.
  
      Returns:
        Dictionary of constructed sparsity mask and
        quantization params, the dictionary will be passed
        to __call__ function.
      """
      result = self._build_sparsity_mask(name, layer)
      result.update(
          super(PrunePreserveDefaultWeightsQuantizer, self).build(
              tensor_shape, name, layer
          )
      )
      return result
  
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 3 for calling the PrunePreserveDefaultWeightsQuantizer obj's underlying member method code with example usage: obj.build(tensor_shape, name, layer) and returns: result