Skip to main content
Log in

Mojo function

elu

elu[type: DType, simd_width: Int](x: SIMD[type, simd_width]) -> SIMD[type, simd_width]

Compute the Elu Op using the equation zifz>=0elsealpha(ez1)z if z >= 0 else alpha*(e^z -1).

Parameters:

  • type (DType): DType used for the computation.
  • simd_width (Int): SIMD width used for the computation.

Args:

  • x (SIMD[type, simd_width]): The value to compute the ELU operation on.

Returns:

The result of the ELU operation.