Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cossio/zygotestructarrays.jl


https://github.com/cossio/zygotestructarrays.jl

Last synced: 10 days ago
JSON representation

Awesome Lists containing this project

README

        

# ZygoteStructArrays.jl

Defines [Zygote](https://github.com/FluxML/Zygote.jl) adjoint rules for [StructArrays](https://github.com/JuliaArrays/StructArrays.jl).

## 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):

```julia
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.