class_docstr: Tests correctness of the `Transpose` bijector.
class_docstr_tok: ["Tests","correctness","of","the","`","Transpose","`","bijector","."]
code: def testInvalidPermException(self):
      msg = "`perm` must be a valid permutation vector."
      if self.is_static or tf.executing_eagerly():
          with self.assertRaisesRegexp(ValueError, msg):
              bijector = transpose.Transpose(
                  perm=[1, 2], validate_args=True
              )
      else:
          with self.assertRaisesOpError(msg):
              bijector = transpose.Transpose(
                  perm=tf1.placeholder_with_default([1, 2], shape=[2]),
                  validate_args=True,
              )
              self.evaluate(bijector.forward([[0, 1]]))
  
imports: import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import invert
  from tensorflow_probability.python.bijectors import transpose
  from tensorflow_probability.python.distributions import independent
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 3 for calling the _TransposeBijectorTest obj's underlying member method code with example usage: obj.testInvalidPermException() without return types