ZygoteStructArrays.jl

Author cossio
Popularity
1 Star
Updated Last
10 Months Ago
Started In
June 2020

ZygoteStructArrays.jl

Defines Zygote adjoint rules for StructArrays.

Usage

Install with ] add ZygoteStructArrays. Then simply import ZygoteStructArrays and the adjoint rules will just work.

Examples

Try to run the following code (without loading this package first):

using Zygote, StructArrays
gradient(randn(2), randn(2)) do X,Y
    S = StructArray{Complex}((X,Y))
    sum(S).re + 2sum(S).im
end

You will get an error. Now load this package and run that again.

Used By Packages

No packages found.