Function dfdx::tensor_ops::ln

source · []
pub fn ln<T: Tensor<Dtype = f32>>(t: T) -> T
Expand description

The Natural Logarithm (ln) computes ln(x)

It’s derivative is 1 / x.

Examples:

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

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

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