class_docstr: Permutes the rightmost dimension of a `Tensor`.
  
  ```python
  reverse = tfp.bijectors.Permute(permutation=[2, 1, 0])
  
  reverse.forward([-1., 0., 1.])
  # ==> [1., 0., -1]
  
  reverse.inverse([1., 0., -1])
  # ==> [-1., 0., 1.]
  
  reverse.forward_log_det_jacobian(any_value)
  # ==> 0.
  
  reverse.inverse_log_det_jacobian(any_value)
  # ==> 0.
  ```
  
  Warning: `tf.estimator` may repeatedly build the graph thus
  `Permute(np.random.permutation(event_size)).astype('int32'))` is not a
  reliable parameterization (nor would it be even if using `tf.constant`). A
  safe alternative is to use `tf.get_variable` to achieve "init once" behavior,
  i.e.,
  
  ```python
  def init_once(x, name):
    return tf.get_variable(name, initializer=x, trainable=False)
  
  Permute(permutation=init_once(
      np.random.permutation(event_size).astype('int32'),
      name='permutation'))
  ```
class_docstr_tok: ["Permutes","the","rightmost","dimension","of","a","`","Tensor","`",".","``","`","python","reverse","=","tfp.bijectors.Permute","(","permutation=","[","2",",","1",",","0","]",")","reverse.forward","(","[","-1.",",","0.",",","1",".","]",")","#","==",">","[","1.",",","0.",",","-1","]","reverse.inverse","(","[","1.",",","0.",",","-1","]",")","#","==",">","[","-1.",",","0.",",","1",".","]","reverse.forward_log_det_jacobian","(","any_value",")","#","==",">","0.","reverse.inverse_log_det_jacobian","(","any_value",")","#","==",">","0",".","``","`","Warning",":","`","tf.estimator","`","may","repeatedly","build","the","graph","thus","`","Permute","(","np.random.permutation","(","event_size",")",")",".astype","(","'int32","'",")",")","`","is","not","a","reliable","parameterization","(","nor","would","it","be","even","if","using","`","tf.constant","`",")",".","A","safe","alternative","is","to","use","`","tf.get_variable","`","to","achieve","``","init","once","''","behavior",",","i.e.",",","``","`","python","def","init_once","(","x",",","name",")",":","return","tf.get_variable","(","name",",","initializer=x",",","trainable=False",")","Permute","(","permutation=init_once","(","np.random.permutation","(","event_size",")",".astype","(","'int32","'",")",",","name='permutation","'",")",")","``","`"]
code: def _parameter_control_dependencies(self, is_init):
      assertions = []
  
      if is_init != tensor_util.is_ref(self.permutation):
          if not dtype_util.is_integer(self.permutation.dtype):
              raise TypeError(
                  "permutation.dtype ({}) should be `int`-like.".format(
                      dtype_util.name(self.permutation.dtype)
                  )
              )
  
          p = tf.get_static_value(self.permutation)
          if p is not None:
              if set(p) != set(np.arange(p.size)):
                  raise ValueError(
                      "Permutation over `d` must contain exactly one of "
                      "each of `{0, 1, ..., d}`."
                  )
  
          if self.validate_args:
              p = tf.sort(self.permutation, axis=-1)
              assertions.append(
                  assert_util.assert_equal(
                      p,
                      tf.range(tf.shape(p)[-1]),
                      message=(
                          "Permutation over `d` must contain exactly one of "
                          "each of `{0, 1, ..., d}`."
                      ),
                  )
              )
  
      return assertions
  
file_path: probability/tensorflow_probability/python/bijectors/permute.py
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 dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
label_desc: Use image node_id 10 for calling the Permute obj's underlying member method code with example usage: obj._parameter_control_dependencies(is_init) and returns: assertions