Skip to content
fn

exp

→Tensor
exp(input: Tensor)

Implementing kernel

C++ engine symbols that back this Python API.

Element-wise natural exponential.

Computes the natural exponential function for each entry of input.

Parameters

inputTensor
Input tensor.

Returns

Tensor

Element-wise result with the same shape as input.

Notes

Mathematical definition:

outi=einputi\text{out}_i = e^{\text{input}_i}

Gradient: ∂out/∂input=ex\partial \text{out}/\partial \text{input} = e^{x}. May overflow to +inf for large inputs.

Examples

>>> import lucid
>>> x = lucid.tensor([1.0, 2.0, 3.0])
>>> lucid.exp(x)
Tensor([...])