PaddedViews.jl
PaddedViews.jl copied to clipboard
PaddedViews does not support Zygote.gradient?
I have a matrix that I want to fill with 0 values using PaddedViews.jl:
f2 = x -> sum(PaddedView(eltype(x)(0.0), x, (5, 5)))
But when using zygote to calculate the gradient:
arr = collect(reshape(1:9, 3, 3))
Zygote.gradient(f2, arr)
The following error occurs:
ERROR: Need an adjoint for constructor PaddedView{Int64, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}, Matrix{Int64}}. Gradient is of type FillArrays.Fill{Int64, 2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}
This bug seems similar to #483