Skip to main content
Log in

Mojo function

relu

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

Compute the Relu Op using the equation max(0,x)max(0, x).

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 RELU operation on.

Returns:

The result of the RELU operation.