class_docstr: Configuration object that helps manage the graph.
docstr: Condition the input on the encoding.
  
  Args:
    x: The [mb, length, channels] float tensor input.
    encoding: The [mb, encoding_length, channels] float tensor encoding.
  
  Returns:
    The output after broadcasting the encoding to x's shape and adding them.
docstr_tok: ["Condition","the","input","on","the","encoding",".","Args",":","x",":","The","[","mb",",","length",",","channels","]","float","tensor","input",".","encoding",":","The","[","mb",",","encoding_length",",","channels","]","float","tensor","encoding",".","Returns",":","The","output","after","broadcasting","the","encoding","to","x","'s","shape","and","adding","them","."]
code: def _condition(x, encoding):
      """Condition the input on the encoding.
  
      Args:
        x: The [mb, length, channels] float tensor input.
        encoding: The [mb, encoding_length, channels] float tensor encoding.
  
      Returns:
        The output after broadcasting the encoding to x's shape and adding them.
      """
      mb, length, channels = x.get_shape().as_list()
      enc_mb, enc_length, enc_channels = encoding.get_shape().as_list()
      assert enc_mb == mb
      assert enc_channels == channels
  
      encoding = tf.reshape(encoding, [mb, enc_length, 1, channels])
      x = tf.reshape(x, [mb, enc_length, -1, channels])
      x += encoding
      x = tf.reshape(x, [mb, length, channels])
      x.set_shape([mb, length, channels])
      return x
  
file_path: magenta/magenta/models/nsynth/wavenet/h512_bo16.py
imports: from magenta.models.nsynth import reader
  from magenta.models.nsynth import utils
  from magenta.models.nsynth.wavenet import masked
  import tensorflow.compat.v1
label_desc: Use image node_id 3 for calling the Config obj's underlying member method code with example usage: obj._condition(x, encoding) and returns: x