Skip to content

vector.geluf

← vector dialect

Lanewise 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, Elementwise

Signature

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

Verification constraints

  • HasFloatElement(result)
  • SameType(input, result)

Examples

%result = vector.geluf<erf> %input : vector<16xf32>
%result = vector.geluf<tanh, afn> %input : vector<16xf32>
%result = vector.geluf<logistic> %input {scale = 1.702} : vector<16xf32>