code: def testVerifyTensorAllFiniteFails(self):
      x_shape = [5, 4]
      x = np.random.random_sample(x_shape).astype(np.float32)
      my_msg = "Input is not a number."
  
      # Test NaN.
      x[0] = np.nan
      with test_util.use_gpu():
          with self.assertRaisesOpError(my_msg):
              t = constant_op.constant(
                  x, shape=x_shape, dtype=dtypes.float32
              )
              t_verified = numerics.verify_tensor_all_finite(t, my_msg)
              self.evaluate(t_verified)
  
      # Test Inf.
      x[0] = np.inf
      with test_util.use_gpu():
          with self.assertRaisesOpError(my_msg):
              t = constant_op.constant(
                  x, shape=x_shape, dtype=dtypes.float32
              )
              t_verified = numerics.verify_tensor_all_finite(t, my_msg)
              self.evaluate(t_verified)
  
imports: import numpy
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import numerics
  from tensorflow.python.ops import while_loop
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the VerifyTensorAllFiniteTest obj's underlying member method code with example usage: obj.testVerifyTensorAllFiniteFails() without return types