fn

fliplr

Tensor
fliplr(input: Tensor)
source

Flip a 2-D-or-higher tensor left-to-right (along axis 1).

Shortcut for flip with dims=[1]. Requires `input.ndim

= 2`.

Parameters

inputTensor
Source tensor with at least 2 dimensions.

Returns

Tensor

Tensor with axis 1 reversed.

Notes

For a matrix AA, this returns AJA J where JJ is the anti-diagonal exchange matrix.

Examples

>>> import lucid
>>> A = lucid.tensor([[1, 2, 3], [4, 5, 6]])
>>> lucid.fliplr(A)
Tensor([[3, 2, 1],
        [6, 5, 4]])