From b52137c71c948fb45825ec084e7bb51b99a5caee Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Tue, 16 Jul 2019 13:23:23 -0400 Subject: [PATCH] use Requires to suppress Cassette overwrite warnings. No idea how but it works --- Project.toml | 1 + src/SparseDiffTools.jl | 21 +++++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Project.toml b/Project.toml index 057d5355..cc65d1ca 100644 --- a/Project.toml +++ b/Project.toml @@ -11,6 +11,7 @@ DiffEqDiffTools = "01453d9d-ee7c-5054-8395-0335cb756afa" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Requires = "ae029012-a4dd-5104-9daa-d747884805df" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" diff --git a/src/SparseDiffTools.jl b/src/SparseDiffTools.jl index 192f0065..b2b55c0a 100644 --- a/src/SparseDiffTools.jl +++ b/src/SparseDiffTools.jl @@ -6,6 +6,7 @@ using SparseArrays, LinearAlgebra, BandedMatrices, BlockBandedMatrices, using BlockBandedMatrices:blocksize,nblocks using ForwardDiff: Dual, jacobian, partials, DEFAULT_CHUNK_THRESHOLD +using Requires using Cassette import Cassette: tag, untag, Tagged, metadata, hasmetadata, istagged, canrecurse import Cassette: tagged_new_tuple, ContextTagged, BindingMeta, DisableHooks, nametype @@ -40,13 +41,17 @@ include("coloring/greedy_star2_coloring.jl") include("coloring/matrix2graph.jl") include("differentiation/compute_jacobian_ad.jl") include("differentiation/jaches_products.jl") -include("program_sparsity/program_sparsity.jl") -include("program_sparsity/sparsity_tracker.jl") -include("program_sparsity/path.jl") -include("program_sparsity/take_all_branches.jl") -include("program_sparsity/terms.jl") -include("program_sparsity/linearity.jl") -include("program_sparsity/hessian.jl") -include("program_sparsity/blas.jl") +function __init__() + @require Cassette="7057c7e9-c182-5462-911a-8362d720325c" begin + include("program_sparsity/program_sparsity.jl") + include("program_sparsity/sparsity_tracker.jl") + include("program_sparsity/path.jl") + include("program_sparsity/take_all_branches.jl") + include("program_sparsity/terms.jl") + include("program_sparsity/linearity.jl") + include("program_sparsity/hessian.jl") + include("program_sparsity/blas.jl") + end +end end # module