fn

flipud

Tensor
flipud(input: Tensor)
source

Flip a 1-D-or-higher tensor upside-down (along axis 0).

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

Parameters

inputTensor
Source tensor.

Returns

Tensor

Tensor with axis 0 reversed.

Notes

Useful for converting between image conventions that disagree on the sign of the row axis.

Examples

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