Skip to contents

Reverses the order of elements along specified axes.

Usage

nv_reverse(x, axes)

Arguments

x

(arrayish)
Input array.

axes

(integer())
Axes to reverse. Negative values count from the end, i.e. -1 refers to the last axis.

Value

arrayish
Has the same shape and data type as x.

See also

prim_reverse() for the underlying primitive.

Examples

x <- nv_array(c(1, 2, 3, 4, 5))
nv_reverse(x, axes = 1L)
#> AnvlArray
#>  5
#>  4
#>  3
#>  2
#>  1
#> [ CPUf32{5} ]