File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -3211,18 +3211,21 @@ end
3211
3211
end
3212
3212
3213
3213
@noinline function gelu (
3214
- x:: TracedRArray{T,N} ,
3214
+ x:: Union{ TracedRArray{T,N},TracedRNumber{T} } ,
3215
3215
approximation:: String ;
3216
3216
location= mlir_stacktrace (" gelu" , @__FILE__ , @__LINE__ ),
3217
3217
) where {T,N}
3218
3218
@assert approximation in (" NONE" , " TANH" , " SIGMOID" )
3219
- return TracedRArray {T,N} (
3220
- (),
3221
- MLIR. IR. result (
3222
- enzymexla. ml_gelu (x. mlir_data; gelu_approximation= approximation, location), 1
3223
- ),
3224
- size (x),
3219
+
3220
+ res = MLIR. IR. result (
3221
+ enzymexla. ml_gelu (x. mlir_data; gelu_approximation= approximation, location), 1
3225
3222
)
3223
+
3224
+ if x isa TracedRArray
3225
+ return TracedRArray {T,N} ((), res, size (x))
3226
+ else
3227
+ return TracedRNumber {T} ((), res)
3228
+ end
3226
3229
end
3227
3230
3228
3231
end # module Ops
You can’t perform that action at this time.
0 commit comments