class_docstr: Annotates layers which quantization should be applied to.
  
  QuantizeAnnotate does not actually apply quantization to the underlying
  layers but acts as a way to specify which layers quantization should be
  applied to.
  
  The wrapper functions as a NoOp or pass-through wrapper by simply delegating
  calls to the underlying layer. The presence of this wrapper indicates to code
  which actually applies quantization to determine which layers should be
  modified.
class_docstr_tok: ["Annotates","layers","which","quantization","should","be","applied","to",".","QuantizeAnnotate","does","not","actually","apply","quantization","to","the","underlying","layers","but","acts","as","a","way","to","specify","which","layers","quantization","should","be","applied","to",".","The","wrapper","functions","as","a","NoOp","or","pass-through","wrapper","by","simply","delegating","calls","to","the","underlying","layer",".","The","presence","of","this","wrapper","indicates","to","code","which","actually","applies","quantization","to","determine","which","layers","should","be","modified","."]
docstr: Create a quantize annotate wrapper over a keras layer.
  
  Args:
    layer: The keras layer to be quantized.
    quantize_config: Optional `QuantizeConfig` to quantize the layer.
    **kwargs: Additional keyword arguments to be passed to the keras layer.
docstr_tok: ["Create","a","quantize","annotate","wrapper","over","a","keras","layer",".","Args",":","layer",":","The","keras","layer","to","be","quantized",".","quantize_config",":","Optional","`","QuantizeConfig","`","to","quantize","the","layer",".","*","*","kwargs",":","Additional","keyword","arguments","to","be","passed","to","the","keras","layer","."]
code: def __init__(self, layer, quantize_config=None, **kwargs):
      """Create a quantize annotate wrapper over a keras layer.
  
      Args:
        layer: The keras layer to be quantized.
        quantize_config: Optional `QuantizeConfig` to quantize the layer.
        **kwargs: Additional keyword arguments to be passed to the keras layer.
      """
      super(QuantizeAnnotate, self).__init__(layer, **kwargs)
  
      if layer is None:
          raise ValueError("`layer` cannot be None.")
  
      # Check against keras.Model since it is an instance of keras.layers.Layer.
      if not isinstance(layer, tf.keras.layers.Layer) or isinstance(
          layer, tf.keras.Model
      ):
          raise ValueError(
              "`layer` can only be a `tf.keras.layers.Layer` instance. "
              "You passed an instance of type: {input}.".format(
                  input=layer.__class__.__name__
              )
          )
  
      self.quantize_config = quantize_config
  
      self._track_trackable(layer, name="layer")
      # Enables end-user to annotate the first layer in Sequential models, while
      # passing the input shape to the original layer.
      #
      # tf.keras.Sequential(
      #   quantize_annotate_layer(tf.keras.layers.Dense(2, input_shape=(3,)))
      # )
      #
      # as opposed to
      #
      # tf.keras.Sequential(
      #   quantize_annotate_layer(tf.keras.layers.Dense(2), input_shape=(3,))
      # )
      #
      # Without this code, the QuantizeAnnotate wrapper doesn't have an input
      # shape and being the first layer, this causes the model to not be
      # built. Being not built is confusing since the end-user has passed an
      # input shape.
      if not hasattr(self, "_batch_input_shape") and hasattr(
          layer, "_batch_input_shape"
      ):
          self._batch_input_shape = self.layer._batch_input_shape
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import tensorflow
  from tensorflow_model_optimization.python.core.quantization.keras import utils
label_desc: Use image node_id 1 to create a new QuantizeAnnotate object from inherited base classes: tf.keras.layers with example: obj = QuantizeAnnotate(layer, quantize_config)