From 88c1f375e336a0e0306ff7310e43b2686fefe59d Mon Sep 17 00:00:00 2001 From: Daniel Ingraham Date: Thu, 20 Jul 2023 12:44:57 -0400 Subject: [PATCH 1/3] Qualify access to TrackedReal and TrackedArray in nonlinear.jl --- src/nonlinear.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nonlinear.jl b/src/nonlinear.jl index 89c0262..e8c2b5b 100644 --- a/src/nonlinear.jl +++ b/src/nonlinear.jl @@ -117,5 +117,5 @@ end # register above rule for ReverseDiff -ReverseDiff.@grad_from_chainrules _implicit(solve, residual, x::TrackedArray, p, drdy, lsolve) -ReverseDiff.@grad_from_chainrules _implicit(solve, residual, x::AbstractVector{<:TrackedReal}, p, drdy, lsolve) \ No newline at end of file +ReverseDiff.@grad_from_chainrules _implicit(solve, residual, x::ReverseDiff.TrackedArray, p, drdy, lsolve) +ReverseDiff.@grad_from_chainrules _implicit(solve, residual, x::AbstractVector{<:ReverseDiff.TrackedReal}, p, drdy, lsolve) From 5b72d817e6a268303efb2c382652543320d44d04 Mon Sep 17 00:00:00 2001 From: Daniel Ingraham Date: Thu, 20 Jul 2023 12:51:58 -0400 Subject: [PATCH 2/3] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 7a03304..a9d6445 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ImplicitAD" uuid = "e7cbb90b-9b31-4eb2-a8c8-45099c074ee1" authors = ["Andrew Ning and contributors"] -version = "0.3" +version = "0.3.1" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" From a9f1dccfa4ceced5eeed19a27412d4a4f04d2cf1 Mon Sep 17 00:00:00 2001 From: Daniel Ingraham Date: Thu, 20 Jul 2023 13:08:47 -0400 Subject: [PATCH 3/3] Missed a few other TrackedArray, TrackedReal references --- src/external.jl | 4 ++-- src/linear.jl | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/external.jl b/src/external.jl index f6592dc..4c87777 100644 --- a/src/external.jl +++ b/src/external.jl @@ -196,5 +196,5 @@ function ChainRulesCore.rrule(::typeof(_provide_rule), func, x, p, mode, jacobia return y, pullback end -ReverseDiff.@grad_from_chainrules _provide_rule(func, x::TrackedArray, p, mode, jacobian, jvp, vjp) -ReverseDiff.@grad_from_chainrules _provide_rule(func, x::AbstractArray{<:TrackedReal}, p, mode, jacobian, jvp, vjp) +ReverseDiff.@grad_from_chainrules _provide_rule(func, x::ReverseDiff.TrackedArray, p, mode, jacobian, jvp, vjp) +ReverseDiff.@grad_from_chainrules _provide_rule(func, x::AbstractArray{<:ReverseDiff.TrackedReal}, p, mode, jacobian, jvp, vjp) diff --git a/src/linear.jl b/src/linear.jl index 4ba4f16..080f67b 100644 --- a/src/linear.jl +++ b/src/linear.jl @@ -199,9 +199,9 @@ function ChainRulesCore.rrule(::typeof(_implicit_linear), A, b, lsolve, Af) end # register above rule for ReverseDiff -ReverseDiff.@grad_from_chainrules _implicit_linear(A::Union{TrackedArray, AbstractArray{<:TrackedReal}}, b, lsolve, Af) -ReverseDiff.@grad_from_chainrules _implicit_linear(A, b::Union{TrackedArray, AbstractArray{<:TrackedReal}}, lsolve, Af) -ReverseDiff.@grad_from_chainrules _implicit_linear(A::Union{TrackedArray, AbstractArray{<:TrackedReal}}, b::Union{TrackedArray, AbstractVector{<:TrackedReal}}, lsolve, Af) +ReverseDiff.@grad_from_chainrules _implicit_linear(A::Union{ReverseDiff.TrackedArray, AbstractArray{<:ReverseDiff.TrackedReal}}, b, lsolve, Af) +ReverseDiff.@grad_from_chainrules _implicit_linear(A, b::Union{ReverseDiff.TrackedArray, AbstractArray{<:ReverseDiff.TrackedReal}}, lsolve, Af) +ReverseDiff.@grad_from_chainrules _implicit_linear(A::Union{ReverseDiff.TrackedArray, AbstractArray{<:ReverseDiff.TrackedReal}}, b::Union{ReverseDiff.TrackedArray, AbstractVector{<:ReverseDiff.TrackedReal}}, lsolve, Af) # function implicit_linear_inplace(A, b, y, Af)