Skip to contents

Divides two tensors element-wise. You can also use the / operator.

Usage

nv_div(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_div() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(10, 20, 30))
  y <- nv_tensor(c(2, 5, 10))
  x / y
})
#> AnvilTensor
#>  5
#>  4
#>  3
#> [ CPUf32{3} ]