-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathmisc.jl
54 lines (51 loc) · 1.68 KB
/
misc.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
@testset "Broadcasting" begin
for ad in every_ad()
@test identity.(ad) == ad
end
end
@testset "Printing" begin
for ad in every_ad_with_options()
@test startswith(string(ad), "Auto")
@test contains(string(ad), "(")
@test endswith(string(ad), ")")
end
sparse_backend1 = AutoSparse(AutoForwardDiff())
sparse_backend2 = AutoSparse(
AutoForwardDiff();
sparsity_detector = FakeSparsityDetector(),
coloring_algorithm = FakeColoringAlgorithm()
)
@test contains(string(sparse_backend1), string(AutoForwardDiff()))
@test length(string(sparse_backend1)) < length(string(sparse_backend2))
end
for backend in [
# dense
ADTypes.AutoChainRules(; ruleconfig = :rc),
ADTypes.AutoDiffractor(),
ADTypes.AutoEnzyme(),
ADTypes.AutoEnzyme(mode = :forward),
ADTypes.AutoFastDifferentiation(),
ADTypes.AutoFiniteDiff(),
ADTypes.AutoFiniteDiff(fdtype = :fd, fdjtype = :fdj, fdhtype = :fdh),
ADTypes.AutoFiniteDifferences(; fdm = :fdm),
ADTypes.AutoForwardDiff(),
ADTypes.AutoForwardDiff(chunksize = 3, tag = :tag),
ADTypes.AutoPolyesterForwardDiff(),
ADTypes.AutoPolyesterForwardDiff(chunksize = 3, tag = :tag),
ADTypes.AutoReverseDiff(),
ADTypes.AutoReverseDiff(compile = true),
ADTypes.AutoSymbolics(),
ADTypes.AutoTapir(),
ADTypes.AutoTapir(safe_mode = false),
ADTypes.AutoTracker(),
ADTypes.AutoZygote(),
# sparse
ADTypes.AutoSparse(ADTypes.AutoForwardDiff()),
ADTypes.AutoSparse(
ADTypes.AutoForwardDiff();
sparsity_detector = FakeSparsityDetector(),
coloring_algorithm = FakeColoringAlgorithm()
)
]
println(backend)
end