parameters: (labeled_tensor, axis_order=None, name=None)
docstring: Permute a tensor's axes.
  
    See tf.transpose.
  
    Args:
      labeled_tensor: The input tensor.
      axis_order: Optional desired axis order, as a list of names. By default, the
        order of axes is reversed.
      name: Optional op name.
  
    Returns:
      The permuted tensor.
  
    Raises:
      ValueError: If axis_order isn't a permutation of the existing axes.
docstring_summary: Permute a tensor's axes.
docstring_tokens: Permute a tensor s axes .
function: def transpose(labeled_tensor, axis_order=None, name=None):
    """Permute a tensor's axes.
  
    See tf.transpose.
  
    Args:
      labeled_tensor: The input tensor.
      axis_order: Optional desired axis order, as a list of names. By default, the
        order of axes is reversed.
      name: Optional op name.
  
    Returns:
      The permuted tensor.
  
    Raises:
      ValueError: If axis_order isn't a permutation of the existing axes.
    """
    with ops.name_scope(name, 'lt_transpose', [labeled_tensor]) as scope:
      labeled_tensor = convert_to_labeled_tensor(labeled_tensor)
  
      original_order = list(labeled_tensor.axes.keys())
      if axis_order is None:
        axis_order = list(reversed(original_order))
      elif sorted(axis_order) != sorted(original_order):
        raise ValueError(
            'The new axis order must have the same names as the original axes, '
            'but the new order is %r while the original order is %r' %
            (axis_order, original_order))
  
      axis_names = list(labeled_tensor.axes.keys())
      permutation = [axis_names.index(n) for n in axis_order]
  
      # Note: TensorFlow doesn't copy data for the identity transpose.
      transpose_tensor = array_ops.transpose(
          labeled_tensor.tensor, permutation, name=scope)
  
      permuted_axes = [labeled_tensor.axes[n] for n in axis_order]
  
      return LabeledTensor(transpose_tensor, permuted_axes)
function_tokens: def transpose ( labeled_tensor , axis_order = None , name = None ) : with ops . name_scope ( name , 'lt_transpose' , [ labeled_tensor ] ) as scope : labeled_tensor = convert_to_labeled_tensor ( labeled_tensor ) original_order = list ( labeled_tensor . axes . keys ( ) ) if axis_order is None : axis_order = list ( reversed ( original_order ) ) elif sorted ( axis_order ) != sorted ( original_order ) : raise ValueError ( 'The new axis order must have the same names as the original axes, ' 'but the new order is %r while the original order is %r' % ( axis_order , original_order ) ) axis_names = list ( labeled_tensor . axes . keys ( ) ) permutation = [ axis_names . index ( n ) for n in axis_order ] # Note: TensorFlow doesn't copy data for the identity transpose. transpose_tensor = array_ops . transpose ( labeled_tensor . tensor , permutation , name = scope ) permuted_axes = [ labeled_tensor . axes [ n ] for n in axis_order ] return LabeledTensor ( transpose_tensor , permuted_axes )