class_docstr: Interface for the core of encoding logic.
  
  This core interface should support encoding being executed in a variety of
  contexts. For instance,
  * Both encoding and decoding can happen in the same location, such as for
    experimental evaluation of efficiency.
  * Both encoding and decoding can happen in different locations, but run in the
    same `Session`, such as distributed datacenter training.
  * Encoding and decoding can happen in multiple locations, and communication
    between them needs to happen outside of `TensorFlow`, such as compressing
    a state of a model which is sent to a mobile device to be later used for
    inference.
  
  This interface is designed such that its implementer need not worry about the
  potential communication patterns, and the implementation will support all.
  
  Each implementation of this interface is supposed to be a relatively
  elementary transformation. In particular, it does not need to realize any
  representation savings by itself. Instead, a particular compositions of these
  elementary transformations will realize the desired savings. These
  compositions are realized by the `Encoder` class.
  
  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.
  
  For an adaptive version with a broader interface, see
  `AdaptiveEncodingStageInterface`.
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` of 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 the
      `get_params` method.
    num_summands: An integer representing the number of summands, if
      `encoded_tensors` is a sum of the encoded representations. The default
      value `None` refers to the case when no summation occurred, and can thus
      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","`","of","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","the","`","get_params","`","method",".","num_summands",":","An","integer","representing","the","number","of","summands",",","if","`","encoded_tensors","`","is","a","sum","of","the","encoded","representations",".","The","default","value","`","None","`","refers","to","the","case","when","no","summation","occurred",",","and","can","thus","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` of 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 the
          `get_params` method.
        num_summands: An integer representing the number of summands, if
          `encoded_tensors` is a sum of the encoded representations. The default
          value `None` refers to the case when no summation occurred, and can thus
          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 7 for calling the EncodingStageInterface obj's underlying member method code with example usage: obj.decode(encoded_tensors, decode_params, num_summands, shape) without return types