asc2.exp

asc2.exp(input: LocalTensor) LocalTensor
asc2.exp(input: RuntimeFloat) PlainValue

Computes the element-wise exponential of input.

The supported data types for the input are: float16, float32.

Parameters:

input – The input value (tensor or scalar)

Returns:

The result tensor

Return type:

LocalTensor

Raises:

RuntimeError – If the input dtype is not supported for this operation

Examples

Compute the element-wise exponential of all tensor elements:

input = asc2.copy_in(tensor, [0, 0], [128, 256])
result = asc2.exp(input)

Compute the exponential of given scalar value:

result = asc2.exp(1.0)

This function can also be called as a member function on LocalTensor, as input.exp(...) instead of exp(input, ...).