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

Square root computes x ^ 0.5 or √x.

The derivative is 0.5 / (x ^ 0.5).

Examples:

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

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

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