This commit is contained in:
Mike Innes 2018-03-05 23:44:25 +00:00
parent bfd6a4c0ec
commit 65ed95190a

View File

@ -1,5 +1,7 @@
module Tracker
import Base: ==
export TrackedArray, TrackedVector, TrackedMatrix, param, back!
tracker(x) = nothing
@ -16,6 +18,9 @@ end
Call(f, args...) = Call{typeof(f),typeof(args)}(f, args)
# When deserialising, the object_id changes
a::Call == b::Call = a.func == b.func && a.args == b.args
@inline (c::Call)() = c.func(data.(c.args)...)
mutable struct Tracked{T}