Skip to content

PartialFunction Does Not Support ConstructionBase.jl #13

@JoshuaBillson

Description

@JoshuaBillson

As discussed in FluxML/Metalhead.jl#286, PartialFunction cannot be reconstructed from its fields. This means it won't work by default with ConstructionBase, which means it won't work by default with Functors.

I've opened PR #12 that adds support for ConstructionBase.jl by implementing a new constructor for PartialFunction.

Here's an example demonstrating the fix:

using PartialFunctions, Flux, Metalhead

m = ResNet(18)

m |> Flux.gpu # this will no longer throw an error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions