This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
1212ForwardDiff = " f6369f11-7733-5829-9624-2563aa707210"
1313Graphs = " 86223c79-3864-5bf0-83f7-82e725a168b6"
1414LinearAlgebra = " 37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15+ Reexport = " 189a3867-3050-52da-a836-e630ba90ab69"
1516Requires = " ae029012-a4dd-5104-9daa-d747884805df"
1617SciMLOperators = " c0aeaf25-5076-4817-a8d5-81caf7dfa961"
1718SparseArrays = " 2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -38,6 +39,7 @@ SciMLOperators = "0.1.19, 0.2"
3839StaticArrays = " 1"
3940Tricks = " 0.1.6"
4041VertexSafeGraphs = " 0.2"
42+ Zygote = " 0.6"
4143julia = " 1.6"
4244
4345[extras ]
Original file line number Diff line number Diff line change 11module SparseDiffToolsZygote
22
3- import Zygote
4-
5- using SparseDiffTools
6- using SparseDiffTools: DeviVecTag, FwdModeAutoDiffVecProd
7-
8- using SparseDiffTools. ForwardDiff
9- using ForwardDiff: Dual, Tag
10-
11- using SparseDiffTools. SciMLOperators: FunctionOperator
12- using SparseDiffTools. Tricks: static_hasmethod
3+ if isdefined (Base, :get_extension )
4+ import Zygote
5+ using SparseDiffTools: SparseDiffTools, DeivVecTag, FwdModeAutoDiffVecProd
6+ using ForwardDiff: ForwardDiff, Dual
7+ using SciMLOperators: FunctionOperator
8+ using Tricks: static_hasmethod
9+ else
10+ import .. Zygote
11+ using .. SparseDiffTools: SparseDiffTools, DeivVecTag, FwdModeAutoDiffVecProd
12+ using .. ForwardDiff: ForwardDiff, Dual
13+ using .. SciMLOperators: FunctionOperator
14+ using .. Tricks: static_hasmethod
15+ end
1316
1417export
1518 numback_hesvec, numback_hesvec!,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ using ArrayInterface: matrix_colors
2020
2121using SciMLOperators
2222import SciMLOperators: update_coefficients, update_coefficients!
23- using Tricks: static_hasmethod
23+ using Tricks: Tricks, static_hasmethod
2424
2525abstract type AbstractAutoDiffVecProd end
2626
@@ -68,14 +68,14 @@ Base.@pure __parameterless_type(T) = Base.typename(T).wrapper
6868parameterless_type (x) = parameterless_type (typeof (x))
6969parameterless_type (x:: Type ) = __parameterless_type (x)
7070
71- if ! isdefined (Base, :get_extension )
72- using Requires
73- end
71+ import Requires
72+ import Reexport
7473
75- function __init__ ( )
76- @static if ! isdefined (Base, :get_extension )
77- @require Zygote= " e88e6eb3-aa80-5325-afca-941959d7151f" begin
74+ @static if ! isdefined (Base, :get_extension )
75+ function __init__ ( )
76+ Requires . @require Zygote = " e88e6eb3-aa80-5325-afca-941959d7151f" begin
7877 include (" ../ext/SparseDiffToolsZygote.jl" )
78+ Reexport. @reexport using . SparseDiffToolsZygote
7979 end
8080 end
8181end
You can’t perform that action at this time.
0 commit comments