code: def bottom_simple(x, model_hparams, vocab_size, name, reuse):
      """Internal bottom transformation."""
      with tf.variable_scope(name, reuse=reuse):
          var = _get_weights(model_hparams, vocab_size)
          x = common_layers.dropout_no_scaling(
              x, 1.0 - model_hparams.symbol_dropout
          )
          # Add together the embeddings for each tuple position.
          ret = tf.add_n(
              [
                  tf.gather(var, x[:, :, :, i] + sum(vocab_size[:i]))
                  * tf.expand_dims(
                      tf.to_float(tf.not_equal(x[:, :, :, i], 0)), -1
                  )
                  for i in range(len(vocab_size))
              ]
          )
          if model_hparams.multiply_embedding_mode == "sqrt_depth":
              ret *= model_hparams.hidden_size**0.5
          return ret
  
file_path: magenta/magenta/models/score2perf/modalities.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: bottom_simple(x, model_hparams, vocab_size, name, reuse) and returns: ret