pymc.math.exp#

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

e^`a`

Computes the element-wise exponential of a tensor.

Parameters:
aTensorLike

Input tensor

Returns:
TensorVariable

Output tensor with the exponential 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.exp(x))
>>> f([0, 1, 2])
array([1., 2.71828183, 7.3890561 ])