Skip to contents

Element-wise cosine. You can also use cos().

Usage

nv_cosine(operand)

Arguments

operand

(tensorish)
Operand.

Value

tensorish
Has the same shape and data type as the input.

See also

nvl_cosine() for the underlying primitive.

Examples

jit_eval({
  x <- nv_tensor(c(0, pi / 2, pi))
  cos(x)
})
#> AnvilTensor
#>   1.0000e+00
#>  -4.3711e-08
#>  -1.0000e+00
#> [ CPUf32{3} ]