Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZygoteRules -> ChainRules #232

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ authors = ["Takafumi Arakaki <[email protected]>"]
version = "0.3.38-DEV"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
Future = "9fa8497b-333b-5362-9e8d-4d0656e87820"
Expand All @@ -12,16 +13,15 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444"

[compat]
ChainRulesCore = "1.0"
Compat = "2.0, 3.0, 4.0"
ConstructionBase = "0.1, 1.0"
InitialValues = "0.2.4, 0.3"
Requires = "0.5, 1.0"
Setfield = "0.5.1, 0.6, 0.7, 0.8, 1"
Tables = "0.2, 1.0"
ZygoteRules = "0.1, 0.2"
julia = "1.0"

[extras]
Expand Down
4 changes: 2 additions & 2 deletions src/BangBang.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ using InitialValues
using LinearAlgebra
using Requires
using Tables: Tables
using ZygoteRules: @adjoint
using ChainRulesCore: ChainRulesCore

include("utils.jl")

Expand All @@ -70,7 +70,7 @@ include("collectors.jl")
include("initials.jl")
include("macro.jl")
include("dataframes_impl.jl")
include("zygote.jl")
include("chainrules.jl")

include("setfield.jl")
using .SetfieldImpl: @set!!, prefermutation
Expand Down
2 changes: 1 addition & 1 deletion src/zygote.jl → src/chainrules.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# https://fluxml.ai/Zygote.jl/dev/adjoints/#Gradient-Reflection-1

# Treat everything immutable during differentiation:
@adjoint possible(_args...) = false, _ -> nothing
ChainRulesCore.rrule(::typeof(possible), _...) = false, _ -> ChainRulesCore.NoTangent()