exp

nvtripy.exp(input: Tensor) Tensor[source]

Computes the elementwise exponential of the elements of the input tensor:

\(\text{exp}(x_{i}) = e^{x_{i}}\)

Parameters:

input (Tensor) – The input tensor.

Returns:

A new tensor.

Return type:

Tensor

INPUT REQUIREMENTS:

input.dtype is one of [float32, float16, bfloat16]

OUTPUT GUARANTEES:

return[0].dtype == input.dtype

Example
1input = tp.arange(3, dtype=tp.float32)
2output = tp.exp(input)
Local Variables
>>> input
tensor([0, 1, 2], dtype=float32, loc=gpu:0, shape=(3,))

>>> output
tensor([1, 2.71828, 7.38906], dtype=float32, loc=gpu:0, shape=(3,))