Skip to content
This repository was archived by the owner on Jun 24, 2022. It is now read-only.

Commit 510eda9

Browse files
committed
fix test/common
1 parent bf6b3d5 commit 510eda9

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

test/common.jl

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,17 @@
11
### Rules
22
using Test
3-
using Cassette, SparsityDetection
4-
using SparseArrays, Test
5-
6-
using Cassette: tag, untag, Tagged, metadata, hasmetadata, istagged
7-
using SparsityDetection: Path, BranchesPass, SparsityContext, Fixed,
8-
Input, Output, pset, Tainted, istainted,
9-
alldone, reset!, HessianSparsityContext
10-
using SparsityDetection: TermCombination
3+
using Cassette
4+
import Cassette: tag, untag, Tagged, metadata, hasmetadata, istagged
5+
using SparseArrays
6+
using SparsityDetection
7+
import SparsityDetection: abstract_run, HessianSparsityContext,
8+
JacobianSparsityContext, TermCombination, HessInput
9+
using Test
1110

1211
Term(i...) = TermCombination(Set([Dict(j=>1 for j in i)]))
1312

1413
function jactester(f, Y, X, args...)
1514
ctx, val = jacobian_sparsity(f, Y, X, args...; raw=true)
16-
val = nothing
17-
while true
18-
val = Cassette.overdub(ctx,
19-
f,
20-
tag(Y, ctx, Output()),
21-
tag(X, ctx, Input()),
22-
map(arg -> arg isa Fixed ?
23-
arg.value :
24-
tag(arg, ctx, pset()), args)...)
25-
println("Explored path: ", path)
26-
alldone(path) && break
27-
reset!(path)
28-
end
29-
return ctx, val
3015
end
3116

3217
jactestmeta(args...) = jactester(args...)[1].metadata

0 commit comments

Comments
 (0)