def build_logits(sequences, embeddings, vocab_size):
  """Builds logits for sequences and a given modality."""
  sequences_shape = common_layers.shape_list(sequences)
  sequences = tf.reshape(sequences, [-1, sequences_shape[-1]])
  # Compute logits.
  logits = tf.matmul(sequences, embeddings, transpose_b=True)
  logits_shape = sequences_shape[:-1] + [1, vocab_size]
  return tf.reshape(logits, logits_shape)
Builds logits for sequences and a given modality.
language/labs/consistent_zero_shot_nmt/utils/model_utils.py