class_docstr: Class for composing individual encoding stages.
  
  This class provides functionality for arbitrarily composing individual
  encoding stages (implementations of `EncodingStageInterface` or
  `AdaptiveEncodingStageInterface`) into a tree, where an output `Tensor` of an
  encoding stage can be further encoded by another encoding stage.
  
  The interface is similar to that of `AdaptiveEncodingStageInterface`, with the
  additional methods `decode_before_sum` and `decode_after_sum`. These methods
  split the decoding functionality to two parts, based on commutativity with
  summation.
  
  Similar to the `AdaptiveEncodingStageInterface`, the methods are designed to
  be functional transformations. That means, for instance, that the
  `initial_state` and `update_state` methods do not modify any underlying state.
  Rather, the user of the `Encoder` class is responsible for storing any values
  if necessary, and providing them back to appropriate methods of this class.
docstr: Constructor of the `Encoder`.
  
  If `stage` is an `EncodingStageInterface`, the constructor will wrap it as
  an `AdaptiveEncodingStageInterface` with no state.
  
  Args:
    stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.
    children: A dictionary mapping a subset of
      `stage.compressible_tensors_keys` to instances of `Encoder` objects,
      which are to be used to further encode the corresponding encoded tensors
      of `stage`.
docstr_tok: ["Constructor","of","the","`","Encoder","`",".","If","`","stage","`","is","an","`","EncodingStageInterface","`",",","the","constructor","will","wrap","it","as","an","`","AdaptiveEncodingStageInterface","`","with","no","state",".","Args",":","stage",":","An","`","EncodingStageInterface","`","or","an","`","AdaptiveEncodingStageInterface","`",".","children",":","A","dictionary","mapping","a","subset","of","`","stage.compressible_tensors_keys","`","to","instances","of","`","Encoder","`","objects",",","which","are","to","be","used","to","further","encode","the","corresponding","encoded","tensors","of","`","stage","`","."]
code: def __init__(self, stage, children):
      """Constructor of the `Encoder`.
  
      If `stage` is an `EncodingStageInterface`, the constructor will wrap it as
      an `AdaptiveEncodingStageInterface` with no state.
  
      Args:
        stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.
        children: A dictionary mapping a subset of
          `stage.compressible_tensors_keys` to instances of `Encoder` objects,
          which are to be used to further encode the corresponding encoded tensors
          of `stage`.
      """
      stage = encoding_stage.as_adaptive_encoding_stage(stage)
      self.stage = stage
      self.children = children
      self._commuting_structure = None
      super(Encoder, self).__init__()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import six
  import tensorflow
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.core import encoding_stage
  from tensorflow_model_optimization.python.core.internal.tensor_encoding.utils import py_utils
label_desc: Use image node_id 1 to create a new Encoder object from inherited base classes: object with example: obj = Encoder(stage, children)