class_docstr: Class for composing and creating `Encoder`.
  
  This class is a utility for separating the creation of the `Encoder` from its
  intended functionality. Each instance of `EncoderComposer` corresponds to a
  node in a tree of encoding stages to be used for encoding.
  
  The `make` method converts this object to an `Encoder`, which exposes the
  encoding functionality.
docstr: Adds a child node.
  
  Args:
    stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.
    key: `string`, specifying the output key of the encoding stage controlled
      by this object, to be further encoded by `stage`.
  
  Returns:
    An `EncoderComposer`, the newly created child node.
  
  Raises:
    KeyError: If `key` is not a compressible tensor of the encoding stage
      controlled by this object, or if it already has a child.
docstr_tok: ["Adds","a","child","node",".","Args",":","stage",":","An","`","EncodingStageInterface","`","or","an","`","AdaptiveEncodingStageInterface","`",".","key",":","`","string","`",",","specifying","the","output","key","of","the","encoding","stage","controlled","by","this","object",",","to","be","further","encoded","by","`","stage","`",".","Returns",":","An","`","EncoderComposer","`",",","the","newly","created","child","node",".","Raises",":","KeyError",":","If","`","key","`","is","not","a","compressible","tensor","of","the","encoding","stage","controlled","by","this","object",",","or","if","it","already","has","a","child","."]
code: def add_child(self, stage, key):
      """Adds a child node.
  
      Args:
        stage: An `EncodingStageInterface` or an `AdaptiveEncodingStageInterface`.
        key: `string`, specifying the output key of the encoding stage controlled
          by this object, to be further encoded by `stage`.
  
      Returns:
        An `EncoderComposer`, the newly created child node.
  
      Raises:
        KeyError: If `key` is not a compressible tensor of the encoding stage
          controlled by this object, or if it already has a child.
      """
      if key not in self._stage.compressible_tensors_keys:
          raise KeyError(
              "The specified key is either not compressible or not "
              "returned by the current encoding stage."
          )
      if key in self._children:
          raise KeyError("The specified key is already used.")
      new_builder = EncoderComposer(stage)
      self._children[key] = new_builder
      return new_builder
  
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 2 for calling the EncoderComposer obj's underlying member method code with example usage: obj.add_child(stage, key) and returns: new_builder