-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathtest.jl
More file actions
59 lines (52 loc) · 1.69 KB
/
test.jl
File metadata and controls
59 lines (52 loc) · 1.69 KB
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
55
56
57
58
59
using DifferentiationInterface
using DifferentiationInterface: AutoZeroForward, AutoZeroReverse
using DifferentiationInterfaceTest
using LinearAlgebra
using ComponentArrays: ComponentArrays
using JLArrays: JLArrays
using SparseMatrixColorings
using StaticArrays: StaticArrays
using Test
LOGGING = get(ENV, "CI", "false") == "false"
zero_backends = [AutoZeroForward(), AutoZeroReverse()]
for backend in zero_backends
@test check_available(backend)
@test check_inplace(backend)
end
@testset "Type stability" begin
test_differentiation(
[
AutoZeroForward(),
AutoZeroReverse(),
SecondOrder(AutoZeroForward(), AutoZeroReverse()),
SecondOrder(AutoZeroReverse(), AutoZeroForward()),
],
default_scenarios(; include_batchified=false, include_constantified=true);
correctness=false,
type_stability=safetypestab(:full),
logging=LOGGING,
)
test_differentiation(
AutoSparse.(zero_backends, coloring_algorithm=GreedyColoringAlgorithm()),
default_scenarios(; include_constantified=true);
correctness=false,
type_stability=safetypestab(:full),
excluded=[
:pushforward, :pullback, :gradient, :derivative, :hvp, :second_derivative
],
logging=LOGGING,
)
end
@testset "Weird arrays" begin
test_differentiation(
[AutoZeroForward(), AutoZeroReverse()],
zero.(vcat(component_scenarios(), static_scenarios(), gpu_scenarios()));
correctness=true,
logging=LOGGING,
)
end
@testset "Empty arrays" begin
test_differentiation(
[AutoZeroForward(), AutoZeroReverse()], empty_scenarios(); excluded=[:jacobian]
)
end;