Skip to content

Commit 0b6434f

Browse files
Load Zygote in extension by checking for julia <1.9 support
1 parent 3bd40df commit 0b6434f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ VertexSafeGraphs = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
2727
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
2828

2929
[extensions]
30-
SparseDiffToolsZygote = "Zygote"
30+
SparseDiffToolsZygoteExt = "Zygote"
3131

3232
[compat]
3333
ADTypes = "0.1"

ext/SparseDiffToolsZygote.jl renamed to ext/SparseDiffToolsZygoteExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
module SparseDiffToolsZygote
1+
module SparseDiffToolsZygoteExt
22

3-
import Zygote
3+
isdefined(Base, :get_extension) ? (import Zygote) : (using ..Zygote)
44
using ADTypes
55
using LinearAlgebra
66
using SparseDiffTools: SparseDiffTools, DeivVecTag, AutoDiffVJP

src/SparseDiffTools.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ function auto_vecjac! end
8484
@static if !isdefined(Base, :get_extension)
8585
function __init__()
8686
Requires.@require Zygote="e88e6eb3-aa80-5325-afca-941959d7151f" begin
87-
include("../ext/SparseDiffToolsZygote.jl")
88-
@reexport using .SparseDiffToolsZygote
87+
include("../ext/SparseDiffToolsZygoteExt.jl")
88+
@reexport using .SparseDiffToolsZygoteExt
8989
end
9090
end
9191
end

0 commit comments

Comments
 (0)