def stacked_highway(input_emb, hidden_sizes, dropout_ratio, mode,
                    layer_norm=True):
  """Construct multiple `highway` layers stacked on top of one another.

  Args:
    input_emb: tensor<float> [..., embedding_size]
    hidden_sizes: list<int> [hidden_size_1, hidden_size_2, ...]
    dropout_ratio: The probability of dropping out each unit in the activation.
        This can be None, and is only applied during training.
    mode: One of the keys from tf.estimator.ModeKeys.
    layer_norm: Boolean indicating whether we should apply layer normalization.

  Returns:
    output_emb: A Tensor with the same shape as `input_emb`, except for the last
        dimension which will have size `hidden_sizes[-1]` instead.
  """
  for i, h in enumerate(hidden_sizes):
    with tf.variable_scope("highway_{}".format(i)):
      input_emb = highway(input_emb, h, dropout_ratio, mode, layer_norm)
  return input_emb
Construct multiple `highway` layers stacked on top of one another.

  Args:
    input_emb: tensor<float> [..., embedding_size]
    hidden_sizes: list<int> [hidden_size_1, hidden_size_2, ...]
    dropout_ratio: The probability of dropping out each unit in the activation.
        This can be None, and is only applied during training.
    mode: One of the keys from tf.estimator.ModeKeys.
    layer_norm: Boolean indicating whether we should apply layer normalization.

  Returns:
    output_emb: A Tensor with the same shape as `input_emb`, except for the last
        dimension which will have size `hidden_sizes[-1]` instead.
  
language/common/layers/common_layers.py