code: def hadamard_quantization(bits):
      """Returns hadamard quanitzation `Encoder`.
  
      The `Encoder` first reshapes the input to a rank-1 `Tensor`, and applies the
      Hadamard transform (rotation). It then applies uniform quantization with the
      extreme values being the minimum and maximum of the rotated vector being
      encoded. Finally, the quantized values are bitpacked to an integer type.
  
      The `Encoder` is a composition of the following encoding stages:
      * `FlattenEncodingStage` - reshaping the input to a vector.
      * `HadamardEncodingStage` - applying the Hadamard transform.
      * `UniformQuantizationEncodingStage` - applying uniform quantization.
      * `BitpackingEncodingStage` - bitpacking the result into integer values.
  
      Args:
        bits: Number of bits to quantize into.
  
      Returns:
        The hadamard quantization `Encoder`.
      """
      return (
          core_encoder.EncoderComposer(
              stages_impl.BitpackingEncodingStage(bits)
          )
          .add_parent(
              stages_impl.UniformQuantizationEncodingStage(bits),
              stages_impl.UniformQuantizationEncodingStage.ENCODED_VALUES_KEY,
          )
          .add_parent(
              stages_impl.HadamardEncodingStage(),
              stages_impl.HadamardEncodingStage.ENCODED_VALUES_KEY,
          )
          .add_parent(
              stages_impl.FlattenEncodingStage(),
              stages_impl.FlattenEncodingStage.ENCODED_VALUES_KEY,
          )
          .make()
      )
  
file_path: model-optimization/tensorflow_model_optimization/python/core/internal/tensor_encoding/encoders/common_encoders.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import core_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import gather_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import simple_encoder
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.stages import stages_impl
label_desc: Use image node_id 5 for calling a global function with example usage: hadamard_quantization(bits) and returns: core_encoder