For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
gelu_quick
def gelu_quick[dtype: DType, simd_width: Int, accum: DType = get_accum_type[dtype]()](x: SIMD[dtype, simd_width]) -> SIMD[dtype, simd_width]
Compute the quick (sigmoid) approximation of the GELU activation: .
Constraints:
Type must be a floating point Dtype.
Parameters:
- βdtype (
DType): DType used for the computation. - βsimd_width (
Int): SIMD width used for the computation. - βaccum (
DType): Higher-precision accumulation dtype used internally; defaults toget_accum_type[dtype]().
Args:
- βx (
SIMD[dtype, simd_width]): The value to compute the quick-GELU operation on.
Returns:
SIMD[dtype, simd_width]: The result of the quick-GELU operation.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!