Function dfdx::tensor_ops::sqrt
source · pub fn sqrt<S: Shape, E: Dtype, D: UnaryKernel<SqrtKernelOp, E>, T: Tape<E, D>>(
t: Tensor<S, E, D, T>
) -> Tensor<S, E, D, T>
Expand description
√t
or t^0.5
The derivative is 0.5 / (t ^ 0.5)
.
Examples:
let t = dev.tensor([-1.0, 0.0, 1.0, 2.0]);
let r = t.sqrt();