mcabbott/LazyStack.jl

Gradients for generators

mcabbott opened this issue · 0 comments

Despite claiming to work with Zygote, generators currently don’t work:

julia> using Zygote, LazyStack

julia> gradient(x -> sum(stack([x,x'])), rand(2,2)) # vector of arrays
([2.0 2.0; 2.0 2.0],)

julia> gradient(x -> sum(stack(x,x')), rand(2,2)) # tuple of arrays
([2.0 2.0; 2.0 2.0],)

julia> gradient(x -> sum(stack(x' for x in [x,x])), rand(2,2)) # generator
ERROR: not yet!