Skip to content

Commit

Permalink
basic comment for Context{I}
Browse files Browse the repository at this point in the history
  • Loading branch information
ToucheSir committed Jun 24, 2022
1 parent 7540bd6 commit 8db910e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/compiler/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ using Core: Typeof
import Base: copy!, IdSet
import Base.Broadcast: broadcasted, materialize!

# Internal container used to track accumulated gradients of mutable types (including params).
# Type param I ∈ (true, false) indicates whether implicit params are in use.
# By default, this should be false unless pullback(f, ::Params) is called.
mutable struct Context{I} <: AContext
cache::Union{IdDict{Any,Any},Nothing}
end
Expand Down Expand Up @@ -47,11 +50,11 @@ function pullback(cx::Context, f, args...)
Incorrect argument order for pullback, please use:
pullback(f, __context__::Context, args)
instead of:
pullback(__context__::Context, f, args)
This is usually caused by a call to pullback in a higher-order @adjoint.
The above warning will become an error in Zygote 0.7.
"""
Expand Down

0 comments on commit 8db910e

Please sign in to comment.