FluxML/Zygote.jl

Use ChainRules types

Open

#603 创建于 2020年4月20日

在 GitHub 查看
 (5 评论) (5 反应) (0 负责人)Julia (1,568 star) (220 fork)batch import
ChainRuleshelp wantedup for grabs

描述

This issue is about swapping Zygote over to use ChainRule's types by default. When #366 is merged rules coming out of ChainRules will use its types like Composite and AbstractZero, but thing created via Source Code Transform (SCT) will still use NamedTuple and nothing.

This is fine as they are mutually compatible because accum falls back to + and ChainRules overloads +.

The use of Base types in Zygote tends to cause issues as its hard to add methods for NamedTuple and nothing, due to type piracy. Especially things like defining linear operations on them (e.g. overloading things from LinearAlgebra), as well as defining addition +. Particular discussion on Composite ans structured differential types is in #462

Related to: #454 #419 #329

贡献者指南