pub fn cos<T: Tensor<Dtype = f32>>(t: T) -> T
Expand description

Cosine function.

It’s derivative is -sin(t)

Examples:

let t = Tensor1D::new([-1.0, 0.0, 1.0, 2.0]);

// use function version
let r = cos(t.clone());

// or the tensor method!
let r2 = t.cos();