Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 583 Bytes

README.md

File metadata and controls

21 lines (14 loc) · 583 Bytes

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.