code: def testNegativeLogPerplexityMasked(self):
      predictions = np.random.randint(4, size=(12, 12, 12, 1))
      targets = np.random.randint(4, size=(12, 12, 12, 1))
      features = {"targets_mask": tf.to_float(tf.ones([12, 12]))}
      with self.test_session() as session:
          scores, _ = metrics.padded_neg_log_perplexity_with_masking(
              tf.one_hot(predictions, depth=4, dtype=tf.float32),
              tf.constant(targets, dtype=tf.int32),
              features,
          )
          a = tf.reduce_mean(scores)
          session.run(tf.global_variables_initializer())
          actual = session.run(a)
      self.assertEqual(actual.shape, ())
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.utils import metrics
  import tensorflow.compat.v1
label_desc: Use image node_id 13 for calling the MetricsTest obj's underlying member method code with example usage: obj.testNegativeLogPerplexityMasked() without return types