Zygote.jl icon indicating copy to clipboard operation
Zygote.jl copied to clipboard

Error in handling splatted arguments

Open FHell opened this issue 5 years ago • 1 comments

The following MWE throws an Error for me. This code will usually be a mistake in practice (this is how it showed up for us), but is valid.

function f(p; kwargs...)
    g(p, kwargs...)
end
   
function g(p, a...)
    p
end

f(5.) # works
gradient(f, 5.) # Error

The error is:

ERROR: MethodError: no method matching (::Zygote.var"#pairs_namedtuple#282"{(),NamedTuple{(),Tuple{}}})(::Tuple{})

FHell avatar Oct 03 '20 06:10 FHell

xref #599, although not sure it's identical.

mcabbott avatar Oct 16 '20 18:10 mcabbott