def get_embeddings(modality, outer_scope, inner_scope="shared"):
  """Returns embeddings for the given modality stricly forcing reuse.

  Args:
    modality: A tensor2tensor.utils.modality.Modality object.
    outer_scope: A variable scope object used as the outer scope.
    inner_scope: A string used as the inner-most variable scope name.

  Returns:
    embeddings: <float32> [vocab_size, emb_size].
  """
  with tf.variable_scope(outer_scope, reuse=True):
    with tf.variable_scope(inner_scope, reuse=True):
      embeddings = modality._get_weights()  # pylint: disable=protected-access
  return embeddings
Returns embeddings for the given modality stricly forcing reuse.

  Args:
    modality: A tensor2tensor.utils.modality.Modality object.
    outer_scope: A variable scope object used as the outer scope.
    inner_scope: A string used as the inner-most variable scope name.

  Returns:
    embeddings: <float32> [vocab_size, emb_size].
  
language/labs/consistent_zero_shot_nmt/utils/model_utils.py