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: Encodes a given `Tensor`.
  
  This method can create TensorFlow variables, which can be updated every time
  the encoding is executed. An example is an encoder that internally remembers
  the error incurred by previous encoding, and adds it to `x` in the next
  iteration, before executing the encoding.
  
  However, this method may be called in an entirely separate graph from all
  other methods. That is, the implementer of this class can *only* assume such
  variables can be accessed from this method but not from others.
  
  Args:
    x: A `Tensor`, input to be encoded.
    encode_params: A dictionary, containing the parameters needed for the
      encoding. The structure needs to be the return structure of the
      `get_params` method.
  
  Returns:
    A dictionary of `Tensor` objects representing the encoded input `x`.
docstr_tok: ["Encodes","a","given","`","Tensor","`",".","This","method","can","create","TensorFlow","variables",",","which","can","be","updated","every","time","the","encoding","is","executed",".","An","example","is","an","encoder","that","internally","remembers","the","error","incurred","by","previous","encoding",",","and","adds","it","to","`","x","`","in","the","next","iteration",",","before","executing","the","encoding",".","However",",","this","method","may","be","called","in","an","entirely","separate","graph","from","all","other","methods",".","That","is",",","the","implementer","of","this","class","can","*","only","*","assume","such","variables","can","be","accessed","from","this","method","but","not","from","others",".","Args",":","x",":","A","`","Tensor","`",",","input","to","be","encoded",".","encode_params",":","A","dictionary",",","containing","the","parameters","needed","for","the","encoding",".","The","structure","needs","to","be","the","return","structure","of","the","`","get_params","`","method",".","Returns",":","A","dictionary","of","`","Tensor","`","objects","representing","the","encoded","input","`","x","`","."]
code: def encode(self, x, encode_params):
      """Encodes a given `Tensor`.
  
      This method can create TensorFlow variables, which can be updated every time
      the encoding is executed. An example is an encoder that internally remembers
      the error incurred by previous encoding, and adds it to `x` in the next
      iteration, before executing the encoding.
  
      However, this method may be called in an entirely separate graph from all
      other methods. That is, the implementer of this class can *only* assume such
      variables can be accessed from this method but not from others.
  
      Args:
        x: A `Tensor`, input to be encoded.
        encode_params: A dictionary, containing the parameters needed for the
          encoding. The structure needs to be the return structure of the
          `get_params` method.
  
      Returns:
        A dictionary of `Tensor` objects representing the encoded input `x`.
      """
  
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 6 for calling the EncodingStageInterface obj's underlying member method code with example usage: obj.encode(x, encode_params) without return types