GraphNeuralNetworks.jl
GraphNeuralNetworks.jl copied to clipboard
`@functor` default for `GNNLayer`s
Consider adding the definitions
function Functors.functor(::Type{<:GNNLayer}, m::T) where T
childr = (; (f => getfield(m, f) for f in fieldnames(T))...)
Tstripped = Base.typename(T).wrapper # remove all parameters. From https://discourse.julialang.org/t/stripping-parameter-from-parametric-types/8293/16
re = x -> Tstripped(x...)
return childr, re
end
so that we don't need to add @functor
to types inheriting from GNNLayer
.
I'm not sure if this change should be considered breaking.