code: def test_paddings_exceptions(self):
      with self.assertRaisesWithPredicateMatch(
          ValueError, "Argument `paddings` must be a vector of pairs."
      ):
          pad.Pad(paddings=-1, validate_args=True)
      with self.assertRaisesWithPredicateMatch(
          ValueError, "Argument `paddings` must be non-negative."
      ):
          pad.Pad(paddings=[[-1, 0]], validate_args=True)
      with self.assertRaisesWithPredicateMatch(
          ValueError,
          (
              "Arguments `axis` and `paddings` must have the same number "
              "of elements."
          ),
      ):
          pad.Pad(paddings=[[1, 0]], axis=[-2, -1], validate_args=True)
  
      if tf.executing_eagerly():
          return
  
      with self.assertRaisesWithPredicateMatch(
          tf.errors.InvalidArgumentError,
          "Argument `paddings` must be a vector of pairs.",
      ):
          b = pad.Pad(
              paddings=tf1.placeholder_with_default([[1]], shape=None),
              axis=-1,
              validate_args=True,
          )
          self.evaluate(b.forward([0]))
      with self.assertRaisesWithPredicateMatch(
          tf.errors.InvalidArgumentError,
          "Argument `paddings` must be non-negative.",
      ):
          b = pad.Pad(
              paddings=tf1.placeholder_with_default(
                  [[-1, 0]], shape=None
              ),
              axis=-1,
              validate_args=True,
          )
          self.evaluate(b.forward([0]))
      with self.assertRaisesWithPredicateMatch(
          tf.errors.InvalidArgumentError,
          (
              "Arguments `axis` and `paddings` must have the same number "
              "of elements."
          ),
      ):
          b = pad.Pad(
              paddings=tf1.placeholder_with_default(
                  [[1, 0]], shape=None
              ),
              axis=[-2, -1],
              validate_args=True,
          )
          self.evaluate(b.forward([0]))
  
file_path: probability/tensorflow_probability/python/bijectors/pad_test.py
imports: import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import pad
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 5 for calling the PadBijectorTest obj's underlying member method code with example usage: obj.test_paddings_exceptions() without return types