|
14 | 14 | A = Float64[0 10 0 0; -1 0 0 0; 0 0 0 0; -2 0 0 0]
|
15 | 15 | test_frule(LinearAlgebra.exp!, A)
|
16 | 16 | end
|
| 17 | + @testset "imbalanced A with no squaring" begin |
| 18 | + # https://github.com/JuliaDiff/ChainRules.jl/issues/595 |
| 19 | + A = [ |
| 20 | + -0.007623430669065629 -0.567237096385192 0.4419041897734335; |
| 21 | + 2.090838913114862 -1.254084243281689 -0.04145771190198238; |
| 22 | + 2.3397892123412833 -0.6650489083959324 0.6387266010923911 |
| 23 | + ] |
| 24 | + test_frule(LinearAlgebra.exp!, A) |
| 25 | + end |
| 26 | + @testset "exhaustive test" begin |
| 27 | + # added to ensure we never hit truncation error |
| 28 | + # https://github.com/JuliaDiff/ChainRules.jl/issues/595 |
| 29 | + rng = MersenneTwister(1) |
| 30 | + for _ in 1:100 |
| 31 | + A = randn(rng, 3, 3) |
| 32 | + test_frule(LinearAlgebra.exp!, A) |
| 33 | + end |
| 34 | + end |
17 | 35 | @testset "hermitian A, T=$T" for T in (Float64, ComplexF64)
|
18 | 36 | A = Matrix(Hermitian(randn(T, n, n)))
|
19 | 37 | test_frule(LinearAlgebra.exp!, A)
|
|
48 | 66 | A = Float64[0 10 0 0; -1 0 0 0; 0 0 0 0; -2 0 0 0]
|
49 | 67 | test_rrule(exp, A; check_inferred=false)
|
50 | 68 | end
|
| 69 | + @testset "imbalanced A with no squaring" begin |
| 70 | + # https://github.com/JuliaDiff/ChainRules.jl/issues/595 |
| 71 | + A = [ |
| 72 | + -0.007623430669065629 -0.567237096385192 0.4419041897734335; |
| 73 | + 2.090838913114862 -1.254084243281689 -0.04145771190198238; |
| 74 | + 2.3397892123412833 -0.6650489083959324 0.6387266010923911 |
| 75 | + ] |
| 76 | + test_rrule(LinearAlgebra.exp, A; check_inferred=false) |
| 77 | + end |
| 78 | + @testset "exhaustive test" begin |
| 79 | + # added to ensure we never hit truncation error |
| 80 | + # https://github.com/JuliaDiff/ChainRules.jl/issues/595 |
| 81 | + rng = MersenneTwister(1) |
| 82 | + for _ in 1:100 |
| 83 | + A = randn(rng, 3, 3) |
| 84 | + test_rrule(LinearAlgebra.exp, A; check_inferred=false) |
| 85 | + end |
| 86 | + end |
51 | 87 | @testset "hermitian A, T=$T" for T in (Float64, ComplexF64)
|
52 | 88 | A = Matrix(Hermitian(randn(T, n, n)))
|
53 | 89 | test_rrule(exp, A; check_inferred=false)
|
|
0 commit comments