Skip to content

Commit c5d5f2e

Browse files
committed
kernelapply
1 parent 32cee87 commit c5d5f2e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/kernel.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,17 @@ mapcall(t, x) = map(func -> func(x), t)
6767

6868
(k::Kernel{M,<:NamedTuple})(x) where {M} = k.f(;mapcall(k.ops, x)...)
6969

70-
(k::Kernel)(x) = k.f(k.ops(x)...)
71-
7270
(k::Kernel{F,S})(x...) where {F, N, S<:NTuple{N,Symbol}} = k(x)
7371

74-
7572
function (k::Kernel{F,S})(x::Tuple) where {F, N, S<:NTuple{N,Symbol}}
7673
k.f(NamedTuple{k.ops}(x))
7774
end
7875

76+
(k::Kernel)(x) = kernelapply(k.f, k.ops(x))
77+
78+
kernelapply(f, par::NamedTuple) = f(par)
7979

80+
kernelapply(f, par::Tuple) = f(par...)
8081

8182
# export kernelize
8283

0 commit comments

Comments
 (0)