class_docstr: Adaptive version of the `EncodingStageInterface`.
  
  This class has the same functionality as the `EncodingStageInterface`, but in
  addition maintains a state, which is adaptive based on the values being
  compressed and can parameterize the way encoding functionality works. Note
  that this is useful only in case where the encoding is executed in multiple
  iterations.
  
  A typical implementation of this interface would be a wrapper of an
  implementation of `EncodingStageInterface, which uses the existing stateless
  transformations and adds state that controls some of the parameters returned
  by the `get_params` method.
  
  The important distinction is that in addition to `encoded_tensors`, the
  `encode` method of this class returns an additional dictionary of
  `state_update_tensors`. The `commutes_with_sum` property talks about summation
  of only the `encoded_tensors`. The `state_update_tensors` can be aggregated
  in more flexible ways, specified by the `state_update_aggregation_modes`
  property, before being passed to the `update_state` method.
  
  Each implementation should also be wrapped by `tf_style_encoding_stage` to
  ensure adherence to the TensorFlow style guide. The adherence is enforced by
  the `BaseEncodingStageTest` test class. See `test_utils.py` for more details.
docstr: Decodes the encoded representation.
  
  This method is the inverse transformation of the `encode` method. The
  `encoded_tensors` argument is expected to be the output structure of
  `encode` method.
  
  The `num_summands` argument is needed because the `decode` some encoding
  stages only commute with sum if the number of summands is known. Consider
  the example of uniform quantization on a specified interval.
  
  Encoding applies a pre-defined linear transformation to the input, and
  maps the resulting values to a discrete set of values. Because of the linear
  transformation, the decoding functionality does not immediately commute with
  sum. However, if we knew how many summands are in the sum, we can determine
  what is the appropriate inverse linear transformation, enabling the
  commutativity.
  
  A simple way to make this functionality available is to add a
  `tf.constant(1, tf.int32)` to the encoded tensors returned by the `encode`
  method.
  
  The problem is that this approach will be often inefficient. Typically, we
  are intereseted in encoding a collection of values, such as all weights of a
  model, and multiple encoding stages might require this information. The
  result will be a lot of redundant information being communicated. Moreover,
  a user interested in this will always have the relevant information already
  available.
  
  Such information can thus be provided to the `decode` method of an encoding
  stage via the `num_summands` argument, which will be handled by higher-level
  interfaces.
  
  Args:
    encoded_tensors: A dictionary containing `Tensor` objects, representing
      the encoded value.
    decode_params: A dictionary, containing the parameters needed for the
      decoding. The structure needs to be the return structure of `get_params`
      method.
    num_summands: An integer representing number of summands, if
      `encoded_tensors` is a sum of the encoded representations. The default
      value `None` is to be interpreted as `1`.
    shape: Required if the `decode_needs_input_shape` property is `True`. A
      shape of the original input to `encode`, if needed for decoding. Can be
      either a `Tensor`, or a python object.
  
  Returns:
    A single decoded `Tensor`.
docstr_tok: ["Decodes","the","encoded","representation",".","This","method","is","the","inverse","transformation","of","the","`","encode","`","method",".","The","`","encoded_tensors","`","argument","is","expected","to","be","the","output","structure","of","`","encode","`","method",".","The","`","num_summands","`","argument","is","needed","because","the","`","decode","`","some","encoding","stages","only","commute","with","sum","if","the","number","of","summands","is","known",".","Consider","the","example","of","uniform","quantization","on","a","specified","interval",".","Encoding","applies","a","pre-defined","linear","transformation","to","the","input",",","and","maps","the","resulting","values","to","a","discrete","set","of","values",".","Because","of","the","linear","transformation",",","the","decoding","functionality","does","not","immediately","commute","with","sum",".","However",",","if","we","knew","how","many","summands","are","in","the","sum",",","we","can","determine","what","is","the","appropriate","inverse","linear","transformation",",","enabling","the","commutativity",".","A","simple","way","to","make","this","functionality","available","is","to","add","a","`","tf.constant","(","1",",","tf.int32",")","`","to","the","encoded","tensors","returned","by","the","`","encode","`","method",".","The","problem","is","that","this","approach","will","be","often","inefficient",".","Typically",",","we","are","intereseted","in","encoding","a","collection","of","values",",","such","as","all","weights","of","a","model",",","and","multiple","encoding","stages","might","require","this","information",".","The","result","will","be","a","lot","of","redundant","information","being","communicated",".","Moreover",",","a","user","interested","in","this","will","always","have","the","relevant","information","already","available",".","Such","information","can","thus","be","provided","to","the","`","decode","`","method","of","an","encoding","stage","via","the","`","num_summands","`","argument",",","which","will","be","handled","by","higher-level","interfaces",".","Args",":","encoded_tensors",":","A","dictionary","containing","`","Tensor","`","objects",",","representing","the","encoded","value",".","decode_params",":","A","dictionary",",","containing","the","parameters","needed","for","the","decoding",".","The","structure","needs","to","be","the","return","structure","of","`","get_params","`","method",".","num_summands",":","An","integer","representing","number","of","summands",",","if","`","encoded_tensors","`","is","a","sum","of","the","encoded","representations",".","The","default","value","`","None","`","is","to","be","interpreted","as","`","1","`",".","shape",":","Required","if","the","`","decode_needs_input_shape","`","property","is","`","True","`",".","A","shape","of","the","original","input","to","`","encode","`",",","if","needed","for","decoding",".","Can","be","either","a","`","Tensor","`",",","or","a","python","object",".","Returns",":","A","single","decoded","`","Tensor","`","."]
code: def decode(
      self,
      encoded_tensors,
      decode_params,
      num_summands=None,
      shape=None,
  ):
      """Decodes the encoded representation.
  
      This method is the inverse transformation of the `encode` method. The
      `encoded_tensors` argument is expected to be the output structure of
      `encode` method.
  
      The `num_summands` argument is needed because the `decode` some encoding
      stages only commute with sum if the number of summands is known. Consider
      the example of uniform quantization on a specified interval.
  
      Encoding applies a pre-defined linear transformation to the input, and
      maps the resulting values to a discrete set of values. Because of the linear
      transformation, the decoding functionality does not immediately commute with
      sum. However, if we knew how many summands are in the sum, we can determine
      what is the appropriate inverse linear transformation, enabling the
      commutativity.
  
      A simple way to make this functionality available is to add a
      `tf.constant(1, tf.int32)` to the encoded tensors returned by the `encode`
      method.
  
      The problem is that this approach will be often inefficient. Typically, we
      are intereseted in encoding a collection of values, such as all weights of a
      model, and multiple encoding stages might require this information. The
      result will be a lot of redundant information being communicated. Moreover,
      a user interested in this will always have the relevant information already
      available.
  
      Such information can thus be provided to the `decode` method of an encoding
      stage via the `num_summands` argument, which will be handled by higher-level
      interfaces.
  
      Args:
        encoded_tensors: A dictionary containing `Tensor` objects, representing
          the encoded value.
        decode_params: A dictionary, containing the parameters needed for the
          decoding. The structure needs to be the return structure of `get_params`
          method.
        num_summands: An integer representing number of summands, if
          `encoded_tensors` is a sum of the encoded representations. The default
          value `None` is to be interpreted as `1`.
        shape: Required if the `decode_needs_input_shape` property is `True`. A
          shape of the original input to `encode`, if needed for decoding. Can be
          either a `Tensor`, or a python object.
  
      Returns:
        A single decoded `Tensor`.
      """
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  import enum
  import six
  import tensorflow
label_desc: Use image node_id 10 for calling the AdaptiveEncodingStageInterface obj's underlying member method code with example usage: obj.decode(encoded_tensors, decode_params, num_summands, shape) without return types