Skip to content

Commit 3a3d991

Browse files
committed
feat: enable for number
1 parent 7fcb9df commit 3a3d991

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Ops.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3225,4 +3225,18 @@ end
32253225
)
32263226
end
32273227

3228+
@noinline function gelu(
3229+
x::TracedRNumber{T},
3230+
approximation::String;
3231+
location=mlir_stacktrace("gelu", @__FILE__, @__LINE__),
3232+
) where {T}
3233+
@assert approximation in ("NONE", "TANH", "SIGMOID")
3234+
return TracedRNumber{T}(
3235+
(),
3236+
MLIR.IR.result(
3237+
enzymexla.ml_gelu(x.mlir_data; gelu_approximation=approximation, location), 1
3238+
),
3239+
)
3240+
end
3241+
32283242
end # module Ops

0 commit comments

Comments
 (0)