class_docstr: Compute `Y = g(X) = transpose_rightmost_dims(X, rightmost_perm)`.
  
  This bijector is semantically similar to `tf.transpose` except that it
  transposes only the rightmost "event" dimensions. That is, unlike
  `tf.transpose` the `perm` argument is itself a permutation of
  `tf.range(rightmost_transposed_ndims)` rather than `tf.range(tf.rank(x))`,
  i.e., users specify the (rightmost) dimensions to permute, not all dimensions.
  
  The actual (forward) transformation is:
  
  ```python
  def forward(x, perm):
    sample_batch_ndims = tf.rank(x) - tf.size(perm)
    perm = tf.concat([
        tf.range(sample_batch_ndims),
        sample_batch_ndims + perm,
    ], axis=0)
    return tf.transpose(x, perm)
  ```
  
  #### Examples
  
  ```python
  tfp.bijectors.Transpose(perm=[1, 0]).forward(
      [
        [[1, 2],
         [3, 4]],
        [[5, 6],
         [7, 8]],
      ])
  # ==>
  #  [
  #    [[1, 3],
  #     [2, 4]],
  #    [[5, 7],
  #     [6, 8]],
  #  ]
  
  # Using `rightmost_transposed_ndims=2` means this bijector has the same
  # semantics as `tf.matrix_transpose`.
  tfp.bijectors.Transpose(rightmost_transposed_ndims=2).inverse(
      [
        [[1, 3],
         [2, 4]],
        [[5, 7],
         [6, 8]],
      ])
  # ==>
  #  [
  #    [[1, 2],
  #     [3, 4]],
  #    [[5, 6],
  #     [7, 8]],
  #  ]
  ```
class_docstr_tok: ["Compute","`","Y","=","g","(","X",")","=","transpose_rightmost_dims","(","X",",","rightmost_perm",")","`",".","This","bijector","is","semantically","similar","to","`","tf.transpose","`","except","that","it","transposes","only","the","rightmost","``","event","''","dimensions",".","That","is",",","unlike","`","tf.transpose","`","the","`","perm","`","argument","is","itself","a","permutation","of","`","tf.range","(","rightmost_transposed_ndims",")","`","rather","than","`","tf.range","(","tf.rank","(","x",")",")","`",",","i.e.",",","users","specify","the","(","rightmost",")","dimensions","to","permute",",","not","all","dimensions",".","The","actual","(","forward",")","transformation","is",":","``","`","python","def","forward","(","x",",","perm",")",":","sample_batch_ndims","=","tf.rank","(","x",")","-","tf.size","(","perm",")","perm","=","tf.concat","(","[","tf.range","(","sample_batch_ndims",")",",","sample_batch_ndims","+","perm",",","]",",","axis=0",")","return","tf.transpose","(","x",",","perm",")","``","`","#","#","#","#","Examples","``","`","python","tfp.bijectors.Transpose","(","perm=","[","1",",","0","]",")",".forward","(","[","[","[","1",",","2","]",",","[","3",",","4","]","]",",","[","[","5",",","6","]",",","[","7",",","8","]","]",",","]",")","#","==",">","#","[","#","[","[","1",",","3","]",",","#","[","2",",","4","]","]",",","#","[","[","5",",","7","]",",","#","[","6",",","8","]","]",",","#","]","#","Using","`","rightmost_transposed_ndims=2","`","means","this","bijector","has","the","same","#","semantics","as","`","tf.matrix_transpose","`",".","tfp.bijectors.Transpose","(","rightmost_transposed_ndims=2",")",".inverse","(","[","[","[","1",",","3","]",",","[","2",",","4","]","]",",","[","[","5",",","7","]",",","[","6",",","8","]","]",",","]",")","#","==",">","#","[","#","[","[","1",",","2","]",",","#","[","3",",","4","]","]",",","#","[","[","5",",","6","]",",","#","[","7",",","8","]","]",",","#","]","``","`"]
code: def _transpose(self, x, perm):
      perm = self._make_perm(ps.rank(x), perm)
      return tf.transpose(a=x, perm=perm)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 19 for calling the Transpose obj's underlying member method code with example usage: obj._transpose(x, perm) and returns: tf