Shortcuts

torch.fliplr

torch.fliplr(input) → Tensor

Flip array in the left/right direction, returning a new tensor.

Flip the entries in each row in the left/right direction. Columns are preserved, but appear in a different order than before.

Note

Equivalent to input[:,::-1]. Requires the array to be at least 2-D.

Parameters

input (Tensor) – Must be at least 2-dimensional.

Example:

>>> x = torch.arange(4).view(2, 2)
>>> x
tensor([[0, 1],
        [2, 3]])
>>> torch.fliplr(x)
tensor([[1, 0],
        [3, 2]])

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources