parameters: (self, permutation, validate_args=False, name=None)
docstring: Creates the `Permute` bijector.
  
      Args:
        permutation: An `int`-like vector-shaped `Tensor` representing the
          permutation to apply to the rightmost dimension of the transformed
          `Tensor`.
        validate_args: Python `bool` indicating whether arguments should be
          checked for correctness.
        name: Python `str`, name given to ops managed by this object.
  
      Raises:
        TypeError: if `not permutation.dtype.is_integer`.
        ValueError: if `permutation` does not contain exactly one of each of
          `{0, 1, ..., d}`.
docstring_summary: Creates the `Permute` bijector.
docstring_tokens: Creates the Permute bijector .
function: def __init__(self, permutation, validate_args=False, name=None):
      """Creates the `Permute` bijector.
  
      Args:
        permutation: An `int`-like vector-shaped `Tensor` representing the
          permutation to apply to the rightmost dimension of the transformed
          `Tensor`.
        validate_args: Python `bool` indicating whether arguments should be
          checked for correctness.
        name: Python `str`, name given to ops managed by this object.
  
      Raises:
        TypeError: if `not permutation.dtype.is_integer`.
        ValueError: if `permutation` does not contain exactly one of each of
          `{0, 1, ..., d}`.
      """
      with ops.name_scope(name, "permute", values=[permutation]):
        permutation = ops.convert_to_tensor(permutation, name="permutation")
        if not permutation.dtype.is_integer:
          raise TypeError("permutation.dtype ({}) should be `int`-like.".format(
              permutation.dtype.name))
        p = tensor_util.constant_value(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}`.")
        elif validate_args:
          p, _ = nn_ops.top_k(
              -permutation, k=array_ops.shape(permutation)[-1], sorted=True)
          permutation = control_flow_ops.with_dependencies([
              check_ops.assert_equal(
                  -p,
                  math_ops.range(array_ops.size(p)),
                  message=("Permutation over `d` must contain exactly one of "
                           "each of `{0, 1, ..., d}`.")),
          ], permutation)
        self._permutation = permutation
        super(Permute, self).__init__(
            forward_min_event_ndims=1,
            is_constant_jacobian=True,
            validate_args=validate_args,
            name=name or "permute")
function_tokens: def __init__ ( self , permutation , validate_args = False , name = None ) : with ops . name_scope ( name , "permute" , values = [ permutation ] ) : permutation = ops . convert_to_tensor ( permutation , name = "permutation" ) if not permutation . dtype . is_integer : raise TypeError ( "permutation.dtype ({}) should be `int`-like." . format ( permutation . dtype . name ) ) p = tensor_util . constant_value ( 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}`." ) elif validate_args : p , _ = nn_ops . top_k ( - permutation , k = array_ops . shape ( permutation ) [ - 1 ] , sorted = True ) permutation = control_flow_ops . with_dependencies ( [ check_ops . assert_equal ( - p , math_ops . range ( array_ops . size ( p ) ) , message = ( "Permutation over `d` must contain exactly one of " "each of `{0, 1, ..., d}`." ) ) , ] , permutation ) self . _permutation = permutation super ( Permute , self ) . __init__ ( forward_min_event_ndims = 1 , is_constant_jacobian = True , validate_args = validate_args , name = name or "permute" )