def testSariScoreE2E(self):
    """Tests the SARI metrics end-to-end."""
    predictions = np.random.randint(4, size=(12, 12, 1, 1, 12))
    targets = np.random.randint(4, size=(12, 12, 1, 1))
    inputs = np.random.randint(4, size=(12, 12, 1, 1))
    with self.test_session() as session:
      scores, _ = sari_hook.sari_score(
          predictions=tf.constant(predictions, dtype=tf.int32),
          labels=tf.constant(targets, dtype=tf.int32),
          features={
              "inputs": tf.constant(inputs, dtype=tf.int32),
          })
      a = tf.reduce_mean(scores)
      session.run(tf.global_variables_initializer())
      session.run(a)
Tests the SARI metrics end-to-end.
tensor2tensor/utils/sari_hook_test.py