Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit ea28647

Browse files
committed
exports working in 1x8
1 parent b99cdf9 commit ea28647

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
1212
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
1313
Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
15+
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
1516
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1617
SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961"
1718
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
@@ -38,6 +39,7 @@ SciMLOperators = "0.1.19, 0.2"
3839
StaticArrays = "1"
3940
Tricks = "0.1.6"
4041
VertexSafeGraphs = "0.2"
42+
Zygote = "0.6"
4143
julia = "1.6"
4244

4345
[extras]

ext/SparseDiffToolsZygote.jl

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
module 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

1417
export
1518
numback_hesvec, numback_hesvec!,

src/SparseDiffTools.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ using ArrayInterface: matrix_colors
2020

2121
using SciMLOperators
2222
import SciMLOperators: update_coefficients, update_coefficients!
23-
using Tricks: static_hasmethod
23+
using Tricks: Tricks, static_hasmethod
2424

2525
abstract type AbstractAutoDiffVecProd end
2626

@@ -68,14 +68,14 @@ Base.@pure __parameterless_type(T) = Base.typename(T).wrapper
6868
parameterless_type(x) = parameterless_type(typeof(x))
6969
parameterless_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
8181
end

0 commit comments

Comments
 (0)