Skip to content

Commit bf85245

Browse files
committed
Use an older version of DI.jl
1 parent ad56716 commit bf85245

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35"
1616

1717
[compat]
1818
ADTypes = "1.2.1"
19-
DifferentiationInterface = "0.6.0"
19+
DifferentiationInterface = "0.5.17"
2020
ForwardDiff = "0.9.0, 0.10.0"
2121
NLPModels = "0.18, 0.19, 0.20, 0.21"
2222
Requires = "1"

src/di.jl

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,14 @@ for (ADGradient, fbackend) in ((:EnzymeADGradient, :AutoEnzyme),
2121
end
2222

2323
function gradient(b::$ADGradient, f, x)
24-
g = DifferentiationInterface.gradient(f, b.extras, b.backend, x)
24+
g = DifferentiationInterface.gradient(f, b.backend, x, b.extras)
25+
# g = DifferentiationInterface.gradient(f, b.extras, b.backend, x)
2526
return g
2627
end
2728

2829
function gradient!(b::$ADGradient, g, f, x)
29-
DifferentiationInterface.gradient!(f, g, b.extras, b.backend, x)
30+
DifferentiationInterface.gradient!(f, g, b.backend, x, b.extras)
31+
# DifferentiationInterface.gradient!(f, g, b.extras, b.backend, x)
3032
return g
3133
end
3234

@@ -57,7 +59,8 @@ for (ADJprod, fbackend) in ((:EnzymeADJprod, :AutoEnzyme),
5759
end
5860

5961
function Jprod!(b::$ADJprod, Jv, f, x, v, ::Val)
60-
DifferentiationInterface.pushforward!(f, Jv, b.extras, b.backend, x, v)
62+
DifferentiationInterface.pushforward!(f, Jv, b.backend, x, v, b.extras)
63+
# DifferentiationInterface.pushforward!(f, Jv, b.extras, b.backend, x, v)
6164
return Jv
6265
end
6366

@@ -88,7 +91,8 @@ for (ADJtprod, fbackend) in ((:EnzymeADJtprod, :AutoEnzyme),
8891
end
8992

9093
function Jtprod!(b::$ADJtprod, Jtv, f, x, v, ::Val)
91-
DifferentiationInterface.pullback!(f, Jtv, b.extras, b.backend, x, v)
94+
DifferentiationInterface.pullback!(f, Jtv, b.backend, x, v, b.extras)
95+
# DifferentiationInterface.pullback!(f, Jtv, b.extras, b.backend, x, v)
9296
return Jtv
9397
end
9498

@@ -119,7 +123,9 @@ for (ADJacobian, fbackend) in ((:EnzymeADJacobian, :AutoEnzyme),
119123
end
120124

121125
function jacobian(b::$ADJacobian, f, x)
122-
return DifferentiationInterface.jacobian(f, b.extras, b.backend, x)
126+
J = DifferentiationInterface.jacobian(f, b.backend, x, b.extras)
127+
# J = DifferentiationInterface.jacobian(f, b.extras, b.backend, x)
128+
return J
123129
end
124130

125131
end
@@ -150,14 +156,15 @@ end
150156
# end
151157
#
152158
# function Hessian(b::$ADHessian, f, x)
153-
# return DifferentiationInterface.hessian(f, b.extras, b.backend, x)
159+
# H = DifferentiationInterface.hessian(f, b.extras, b.backend, x)
160+
# return H
154161
# end
155162
#
156163
# end
157164
# end
158165

159166
# for (ADHvprod, fbackend) in ((:EnzymeADHvprod, :AutoEnzyme),
160-
# (:ZygoteADHvprod, :AutoZygote))
167+
# (:ZygoteADHvprod, :AutoZygote))
161168
# @eval begin
162169
#
163170
# struct $ADHvprod{B, E} <: ADBackend

0 commit comments

Comments
 (0)