Skip to content

Unnecessary typeassert for ADAGrad #1410

Open
@theogf

Description

@theogf

So this is probably a copy of #832 and #816. But I don't think the arguments apply in my case.
When using apply! with ADAGrad, there is the line

acc = get!(() -> fill!(similar(x), ϵ), o.acc, x)::typeof(x)
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