def _bilinear_score(context_emb, question_emb):
  """Compute a bilinear score between the context and question embeddings.

  Args:
    context_emb: <float32> [batch_size, max_context_len, hidden_size]
    question_emb: <float32> [batch_size, hidden_size]

  Returns:
    scores: <float32> [batch_size, max_context_len]
  """
  # [batch_size, hidden_size]
  projected_question_emb = tf.layers.dense(question_emb,
                                           tensor_utils.shape(context_emb, -1))

  # [batch_size, max_context_len, 1]
  scores = tf.matmul(context_emb, tf.expand_dims(projected_question_emb, -1))

  return tf.squeeze(scores, -1)
Compute a bilinear score between the context and question embeddings.

  Args:
    context_emb: <float32> [batch_size, max_context_len, hidden_size]
    question_emb: <float32> [batch_size, hidden_size]

  Returns:
    scores: <float32> [batch_size, max_context_len]
  
language/question_answering/decatt_docreader/layers/document_reader.py