Skip to content

@functor default for GNNLayers  #288

@CarloLucibello

Description

@CarloLucibello

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions