Skip to content

scalar.geluf

scalar dialect

GELU activation preserving the chosen formula family. The logistic variant carries its scale as an explicit attribute so importers do not encode approximation identity through arithmetic constants.

Operation contract

Property Value
Semantic phase executable
Traits Pure

Signature

Kind Name Type Cardinality Description
Operand input float required
Result result float required
Attribute variant enum GeluVariant required
Attribute fastmath flags FastMathFlags optional
Attribute scale f64 optional

Verification constraints

  • SameType(input, result)

Examples

%result = scalar.geluf<erf> %input : f32
%result = scalar.geluf<tanh, afn> %input : f32
%result = scalar.geluf<logistic> %input {scale = 1.702} : f32