Skip to content

Commit

Permalink
Load Zygote in extension by checking for julia <1.9 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaibhavdixit02 committed Jun 15, 2023
1 parent 3bd40df commit 0b6434f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ VertexSafeGraphs = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[extensions]
SparseDiffToolsZygote = "Zygote"
SparseDiffToolsZygoteExt = "Zygote"

[compat]
ADTypes = "0.1"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module SparseDiffToolsZygote
module SparseDiffToolsZygoteExt

import Zygote
isdefined(Base, :get_extension) ? (import Zygote) : (using ..Zygote)
using ADTypes
using LinearAlgebra
using SparseDiffTools: SparseDiffTools, DeivVecTag, AutoDiffVJP
Expand Down
4 changes: 2 additions & 2 deletions src/SparseDiffTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ function auto_vecjac! end
@static if !isdefined(Base, :get_extension)
function __init__()
Requires.@require Zygote="e88e6eb3-aa80-5325-afca-941959d7151f" begin
include("../ext/SparseDiffToolsZygote.jl")
@reexport using .SparseDiffToolsZygote
include("../ext/SparseDiffToolsZygoteExt.jl")
@reexport using .SparseDiffToolsZygoteExt
end
end
end
Expand Down

0 comments on commit 0b6434f

Please sign in to comment.