docstr: Tests the SARI metrics end-to-end.
docstr_tok: ["Tests","the","SARI","metrics","end-to-end","."]
code: 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)
  
file_path: tensor2tensor/tensor2tensor/utils/sari_hook_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import numpy
  from tensor2tensor.utils import sari_hook
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling the SariHookTest obj's underlying member method code with example usage: obj.testSariScoreE2E() without return types