Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cossio/zygotestructarrays.jl
https://github.com/cossio/zygotestructarrays.jl
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/cossio/zygotestructarrays.jl
- Owner: cossio
- Created: 2020-06-07T22:06:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-01-15T21:01:35.000Z (almost 3 years ago)
- Last Synced: 2024-10-11T10:56:58.507Z (26 days ago)
- Language: Julia
- Size: 13.7 KB
- Stars: 1
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.