aws_lambda/pytorch/source/torch/functional.py
def unique(input, sorted=False, return_inverse=False, dim=None):
    r"""Returns the unique scalar elements of the input tensor as a 1-D tensor.

    Arguments:
        input (Tensor): the input tensor
        sorted (bool): Whether to sort the unique elements in ascending order
            before returning as output.
        return_inverse (bool): Whether to also return the indices for where
            elements in the original input ended up in the returned unique list.
        dim (int): the dimension to apply unique. If ``None``, the unique of the
            flattened input is returned. default: ``None``

    Returns:
        (Tensor, Tensor (optional)): A tensor or a tuple of tensors containing

            - **output** (*Tensor*): the output list of unique scalar elements.
            - **inverse_indices** (*Tensor*): (optional) if
              :attr:`return_inverse` is True, there will be a
              2nd returned tensor (same shape as input) representing the indices
              for where elements in the original input map to in the output;
              otherwise, this function will only return a single tensor.

    Example::

        >>> output = torch.unique(torch.tensor([1, 3, 2, 3], dtype=torch.long))
        >>> output
        tensor([ 2,  3,  1])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([1, 3, 2, 3], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([ 0,  2,  1,  2])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([[1, 3], [2, 3]], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([[ 0,  2],
                [ 1,  2]])

    """
    if dim is not None:
        output, inverse_indices = torch._unique_dim(
            input,
            dim,
            sorted=sorted,
            return_inverse=return_inverse
        )
    else:
        output, inverse_indices = torch._unique(
            input,
            sorted=sorted,
            return_inverse=return_inverse,
        )
    if return_inverse:
        return output, inverse_indices
    else:
        return output
r"""Returns the unique scalar elements of the input tensor as a 1-D tensor.

    Arguments:
        input (Tensor): the input tensor
        sorted (bool): Whether to sort the unique elements in ascending order
            before returning as output.
        return_inverse (bool): Whether to also return the indices for where
            elements in the original input ended up in the returned unique list.
        dim (int): the dimension to apply unique. If ``None``, the unique of the
            flattened input is returned. default: ``None``

    Returns:
        (Tensor, Tensor (optional)): A tensor or a tuple of tensors containing

            - **output** (*Tensor*): the output list of unique scalar elements.
            - **inverse_indices** (*Tensor*): (optional) if
              :attr:`return_inverse` is True, there will be a
              2nd returned tensor (same shape as input) representing the indices
              for where elements in the original input map to in the output;
              otherwise, this function will only return a single tensor.

    Example::

        >>> output = torch.unique(torch.tensor([1, 3, 2, 3], dtype=torch.long))
        >>> output
        tensor([ 2,  3,  1])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([1, 3, 2, 3], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([ 0,  2,  1,  2])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([[1, 3], [2, 3]], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([[ 0,  2],
                [ 1,  2]])

    
r"""Returns the unique scalar elements of the input tensor as a 1-D tensor.
r " " " Returns the unique scalar elements of the input tensor as a 1 - D tensor .
def unique(input, sorted=False, return_inverse=False, dim=None):
    if dim is not None:
        output, inverse_indices = torch._unique_dim(
            input,
            dim,
            sorted=sorted,
            return_inverse=return_inverse
        )
    else:
        output, inverse_indices = torch._unique(
            input,
            sorted=sorted,
            return_inverse=return_inverse,
        )
    if return_inverse:
        return output, inverse_indices
    else:
        return output
def unique ( input , sorted = False , return_inverse = False , dim = None ) : if dim is not None : output , inverse_indices = torch . _unique_dim ( input , dim , sorted = sorted , return_inverse = return_inverse ) else : output , inverse_indices = torch . _unique ( input , sorted = sorted , return_inverse = return_inverse , ) if return_inverse : return output , inverse_indices else : return output
r"""Returns the unique scalar elements of the input tensor as a 1-D tensor.
r " " " Returns the unique scalar elements of the input tensor as a 1 - D tensor .
r"""Returns the unique scalar elements of the input tensor as a 1-D tensor.

    Arguments:
        input (Tensor): the input tensor
        sorted (bool): Whether to sort the unique elements in ascending order
            before returning as output.
        return_inverse (bool): Whether to also return the indices for where
            elements in the original input ended up in the returned unique list.
        dim (int): the dimension to apply unique. If ``None``, the unique of the
            flattened input is returned. default: ``None``

    Returns:
        (Tensor, Tensor (optional)): A tensor or a tuple of tensors containing

            - **output** (*Tensor*): the output list of unique scalar elements.
            - **inverse_indices** (*Tensor*): (optional) if
              :attr:`return_inverse` is True, there will be a
              2nd returned tensor (same shape as input) representing the indices
              for where elements in the original input map to in the output;
              otherwise, this function will only return a single tensor.

    Example::

        >>> output = torch.unique(torch.tensor([1, 3, 2, 3], dtype=torch.long))
        >>> output
        tensor([ 2,  3,  1])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([1, 3, 2, 3], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([ 0,  2,  1,  2])

        >>> output, inverse_indices = torch.unique(
                torch.tensor([[1, 3], [2, 3]], dtype=torch.long), sorted=True, return_inverse=True)
        >>> output
        tensor([ 1,  2,  3])
        >>> inverse_indices
        tensor([[ 0,  2],
                [ 1,  2]])

    """
(Tensor, Tensor (optional)): A tensor or a tuple of tensors containing

output** (*Tensor*): the output list of unique scalar elements.
inverse_indices** (*Tensor*): (optional) if
:attr:`return_inverse` is True, there will be a
2nd returned tensor (same shape as input) representing the indices
for where elements in the original input map to in the output;
otherwise, this function will only return a single tensor.
( Tensor Tensor ( optional )) : A tensor or a tuple of tensors containing output ** ( * Tensor * ) : the output list of unique scalar elements . inverse_indices ** ( * Tensor * ) : ( optional ) if : attr : ` return_inverse ` is True there will be a 2nd returned tensor ( same shape as input ) representing the indices for where elements in the original input map to in the output ; otherwise this function will only return a single tensor .
input
the input tensor
the input tensor
sorted
Whether to sort the unique elements in ascending order
before returning as output.
Whether to sort the unique elements in ascending order before returning as output .
return_inverse
Whether to also return the indices for where
elements in the original input ended up in the returned unique list.
Whether to also return the indices for where elements in the original input ended up in the returned unique list .
dim
the dimension to apply unique. If ``None``, the unique of the
flattened input is returned. default: ``None``
the dimension to apply unique . If ` ` None ` ` the unique of the flattened input is returned . default : ` ` None ` `