Skip to contents

Reverses the order of elements along specified dimensions.

Usage

nv_reverse(operand, dims)

Arguments

operand

(tensorish)
Operand.

dims

(integer())
Dimensions to reverse.

Value

tensorish
Has the same shape and data type as operand.

See also

nvl_reverse() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(1, 2, 3, 4, 5))
  nv_reverse(x, dims = 1L)
})
#> AnvilTensor
#>  5
#>  4
#>  3
#>  2
#>  1
#> [ CPUf32{5} ]