code: def testNegativeLogPerplexityMaskedAssert(self):
      predictions = np.random.randint(4, size=(12, 12, 12, 1))
      targets = np.random.randint(4, size=(12, 12, 12, 1))
      features = {}
  
      with self.assertRaisesRegexp(
          ValueError,
          "masked_neg_log_perplexity requires targets_mask feature",
      ):
          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())
              _ = session.run(a)
  
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 14 for calling the MetricsTest obj's underlying member method code with example usage: obj.testNegativeLogPerplexityMaskedAssert() without return types