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