Skip to main content
Log in

Mojo function

relu_n1

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

Compute the Relu N1 Op using the equation max(min(x,1),1)max(min(x,1),-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 RELU N1 operation on.

Returns:

The result of the RELU N1 operation.