You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is example is a simplified version of something I'm doing with FillArrays and Zygote, and definitely computes the wrong result. Any thoughts?
using Zygote, Flux
# A vector of length 10struct MyFill{T} <:AbstractVector{T}
value::Tend
Base.getindex(m::MyFill, n::Int) = m.value
Base.size(m::MyFill) = (10,)
foo(x) =sum(MyFill(x))
# This yields the right answer :)
Flux.gradient(foo, 5.0)
# This yields the wrong answer :(
Zygote.gradient(foo, 5.0)
The text was updated successfully, but these errors were encountered:
This is example is a simplified version of something I'm doing with
FillArrays
andZygote
, and definitely computes the wrong result. Any thoughts?The text was updated successfully, but these errors were encountered: