pymc.math.log#

pymc.math.log = Elemwise(scalar_op=log,inplace_pattern=<frozendict {}>)[source]#

base e logarithm of a

Computes the element-wise natural logarithm of a tensor.

Parameters:
aTensorLike

Input tensor

Returns:
TensorVariable

Output tensor with the natural logarithm of each element in a

Examples

>>> import pytensor
>>> import pytensor.tensor as pt
>>> import numpy as np
>>> x = pt.vector("x")
>>> f = pytensor.function([x], pt.log(x))
>>> f([1, 2.7, 10])
array([0., 0.99325178, 2.30258509])