|
5 | 5 | using ADTypes |
6 | 6 | using ADTypes: ForwardOrReverseMode, ForwardMode, ReverseMode |
7 | 7 | using ForwardDiff: ForwardDiff |
| 8 | + using LinearAlgebra: Factorization, TransposeFactorization |
8 | 9 | using Zygote: Zygote |
9 | 10 | using Test |
10 | 11 |
|
| 12 | + const GenericMatrix = Union{AbstractMatrix,Factorization,TransposeFactorization} |
| 13 | + |
11 | 14 | solver(x) = sqrt.(x), nothing |
12 | 15 | conditions(x, y, z) = y .^ 2 .- x |
13 | 16 |
|
|
41 | 44 | @test prep.prep_Aᵀ === nothing |
42 | 45 | @test prep.prep_B !== nothing |
43 | 46 | @test prep.prep_Bᵀ === nothing |
44 | | - @test build_A(implicit, prep, x, y, z, c; suggested_backend) isa AbstractMatrix |
45 | | - @test build_Aᵀ(implicit, prep, x, y, z, c; suggested_backend) isa AbstractMatrix |
| 47 | + @test build_A(implicit, prep, x, y, z, c; suggested_backend) isa GenericMatrix |
| 48 | + @test build_Aᵀ(implicit, prep, x, y, z, c; suggested_backend) isa GenericMatrix |
46 | 49 | @test build_B(implicit, prep, x, y, z, c; suggested_backend) isa JVP |
47 | 50 | @test build_Bᵀ(implicit, prep, x, y, z, c; suggested_backend) isa VJP |
48 | 51 | end |
|
53 | 56 | @test prep.prep_Aᵀ !== nothing |
54 | 57 | @test prep.prep_B === nothing |
55 | 58 | @test prep.prep_Bᵀ !== nothing |
56 | | - @test build_A(implicit, prep, x, y, z, c; suggested_backend) isa AbstractMatrix |
57 | | - @test build_Aᵀ(implicit, prep, x, y, z, c; suggested_backend) isa AbstractMatrix |
| 59 | + @test build_A(implicit, prep, x, y, z, c; suggested_backend) isa GenericMatrix |
| 60 | + @test build_Aᵀ(implicit, prep, x, y, z, c; suggested_backend) isa GenericMatrix |
58 | 61 | @test build_B(implicit, prep, x, y, z, c; suggested_backend) isa JVP |
59 | 62 | @test build_Bᵀ(implicit, prep, x, y, z, c; suggested_backend) isa VJP |
60 | 63 | end |
|
0 commit comments