Skip to contents

Raises lhs to the power of rhs element-wise. You can also use the ^ operator.

Usage

nv_pow(lhs, rhs)

Arguments

lhs, rhs

(tensorish)
Left and right operand. Operands are promoted to a common data type. Scalars are broadcast to the shape of the other operand.

Value

tensorish
Has the same shape and the promoted common data type of the inputs.

See also

nvl_pow() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(2, 3, 4))
  y <- nv_tensor(c(3, 2, 1))
  x ^ y
})
#> AnvilTensor
#>  8
#>  9
#>  4
#> [ CPUf32{3} ]