Skip to content

AD failing with ComponentArrays #126

@gdalle

Description

@gdalle

Hi there, and thanks for the great package
Are ComponentArrays supposed to be AD-compatible? If so, did I do something wrong with the following code?

julia> using ComponentArrays, Zygote

julia> function mysum(x::AbstractVector)
           y = ComponentVector(x=x)
           return sum(y)
       end
mysum (generic function with 1 method)

julia> Zygote.gradient(mysum, rand(10))
ERROR: MethodError: no method matching size(::NamedTuple{(:x,), Tuple{Vector{Float64}}})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions