Skip to content

Commit

Permalink
chore: format suggestion
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
avik-pal and github-actions[bot] committed Jul 4, 2024
1 parent 9301f46 commit 509e152
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/layers/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ function (wf::WrappedFunction)(x, ps, st::NamedTuple)
return __maybe_direct_call(wf.func, x, ps, st, Val(false))
end

@generated function (wf::WrappedFunction{:runtime_check, F})(x, ps, st::NamedTuple) where {F}
DC = hasmethod(F, (typeof(x), typeof(ps), typeof(st)))
return :(__maybe_direct_call(wf.func, x, ps, st, Val($(!DC))))
@generated function (wf::WrappedFunction{:runtime_check, F})(
x, ps, st::NamedTuple) where {F}
DC = hasmethod(F, Tuple{typeof(x)})
return :(__maybe_direct_call(wf.func, x, ps, st, Val($(DC))))
end

@inline __maybe_direct_call(f, x, ps, st, ::Val{false}) = f(x, ps, st)
Expand Down

0 comments on commit 509e152

Please sign in to comment.