def predict(is_train, embeddings, premise_tensors, hypothesis_tensors):
  """Compute the class logit predictions.

  Args:
    is_train: bool, are we in train mode
    embeddings: `embedding_utils.PretrainedWordEmbeddings` to embed with
    premise_tensors: batched premise tensors from `build_tensorize_text_fn`
    hypothesis_tensors: batched hypothesis tensors from
      `build_tensorize_text_fn`

  Returns:
    logits: <tf.float32>[batch, 3] Scores for each class (for checkpoint
            comparability, the BoolQ models also produce a neutral logit)
  """
  with tf.variable_scope("embed"):
    premise = embed_text(premise_tensors, embeddings)
    premise_lens = premise_tensors["len"]
  with tf.variable_scope("embed", reuse=True):
    hypothesis = embed_text(hypothesis_tensors, embeddings)
    hypothesis_len = hypothesis_tensors["len"]

  e_drop = FLAGS.embed_dropout_rate
  premise = variational_dropout(premise, e_drop, is_train)
  hypothesis = variational_dropout(hypothesis, e_drop, is_train)

  with tf.variable_scope("embed/encode-text/layer-1"):
    premise = apply_highway_lstm(premise, premise_lens)
  with tf.variable_scope("embed/encode-text/layer-1", reuse=True):
    hypothesis = apply_highway_lstm(hypothesis, hypothesis_len)

  with tf.variable_scope("fuse"):
    with tf.variable_scope("attention"):
      atten = compute_attention(premise, hypothesis)
      atten = mask_attention(atten, premise_lens, hypothesis_len)

    attended_h = tf.matmul(tf.nn.softmax(atten), hypothesis)
    attended_p = tf.matmul(
        tf.nn.softmax(tf.transpose(atten, [0, 2, 1])), premise)
    premise = tf.concat([premise, attended_h, attended_h * premise], 2)
    hypothesis = tf.concat([hypothesis, attended_p, attended_p * hypothesis], 2)

  with tf.variable_scope("post-process/layer-0"):
    premise = apply_highway_lstm(premise, premise_lens)
  with tf.variable_scope("post-process/layer-0", reuse=True):
    hypothesis = apply_highway_lstm(hypothesis, hypothesis_len)

  drop = FLAGS.dropout_rate
  premise = variational_dropout(premise, drop, is_train)
  hypothesis = variational_dropout(hypothesis, drop, is_train)

  with tf.variable_scope("pool/atten-pool"):
    premise = pool(premise, premise_lens)
  with tf.variable_scope("pool/atten-pool", reuse=True):
    hypothesis = pool(hypothesis, hypothesis_len)

  joint_embed = tf.concat([premise, hypothesis], 1)
  with tf.variable_scope("post-processs-pooled/layer-1"):
    joint_embed = tf.layers.dense(
        joint_embed, units=FLAGS.ffn_dim, activation="relu")

  joint_embed = dropout(joint_embed, drop, is_train)

  with tf.variable_scope("predict"):
    # Use three classes even for BoolQ so the checkpoint are compatible
    n_classes = 3
    logits = tf.layers.dense(joint_embed, units=n_classes, activation=None)

  return logits
Compute the class logit predictions.

  Args:
    is_train: bool, are we in train mode
    embeddings: `embedding_utils.PretrainedWordEmbeddings` to embed with
    premise_tensors: batched premise tensors from `build_tensorize_text_fn`
    hypothesis_tensors: batched hypothesis tensors from
      `build_tensorize_text_fn`

  Returns:
    logits: <tf.float32>[batch, 3] Scores for each class (for checkpoint
            comparability, the BoolQ models also produce a neutral logit)
  
language/boolq/run_recurrent_model_boolq.py