Skip to content

Unnecessary typeassert for ADAGrad #217

@theogf

Description

@theogf

So this is probably a copy of FluxML/Flux.jl#832 and FluxML/Flux.jl#816. But I don't think the arguments apply in my case.
When using apply! with ADAGrad, there is the line https://github.com/FluxML/Flux.jl/blob/075f42b47892506fabd2d77c8e9887bec33d02a9/src/optimise/optimisers.jl#L348 but this is true in general for other optimisers.
The type assertion assumes that it should be of the same type as x and it's an issue.

I am working with views therefore the type of x is SubArray{...}, however zero(x) will of course return an Array{...} and the resulting output will not pass the type assertion.

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