Function dfdx::tensor_ops::cos

source ·
pub fn cos<S: Shape, E: Dtype, D: UnaryKernel<CosKernelOp, E>, T: Tape<E, D>>(
    t: Tensor<S, E, D, T>
) -> Tensor<S, E, D, T>
Expand description

Cosine function.

It’s derivative is -sin(t)

Examples:

let t = dev.tensor([-1.0, 0.0, 1.0, 2.0]);
let r = t.cos();