From 4b1655e831b163fdee0aaefa0dcc83bada0e112e Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Fri, 3 Dec 2021 16:24:07 -0600 Subject: [PATCH 1/2] fix for julia 1.7 --- test/rulesets/LinearAlgebra/structured.jl | 4 ++-- test/rulesets/LinearAlgebra/symmetric.jl | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/test/rulesets/LinearAlgebra/structured.jl b/test/rulesets/LinearAlgebra/structured.jl index afd02589e..7a02223d8 100644 --- a/test/rulesets/LinearAlgebra/structured.jl +++ b/test/rulesets/LinearAlgebra/structured.jl @@ -7,8 +7,8 @@ @testset "\\ $T on LHS" for T in (Diagonal, UpperTriangular, LowerTriangular) LHS = T(randn(T == Diagonal ? 10 : (10, 10))) - test_rrule(\, LHS, randn(Float32, 10); rtol = 1.0e-4, atol = 1.0e-4) - test_rrule(\, LHS, randn(Float32, 10, 10); rtol = 1.0e-4, atol = 1.0e-4) + test_rrule(\, LHS, randn(Float32, 10); rtol = 1.0e-3, atol = 1.0e-3) + test_rrule(\, LHS, randn(Float32, 10, 10); rtol = 1.0e-3, atol = 1.0e-3) end end diff --git a/test/rulesets/LinearAlgebra/symmetric.jl b/test/rulesets/LinearAlgebra/symmetric.jl index a007d1272..e4e01d3d8 100644 --- a/test/rulesets/LinearAlgebra/symmetric.jl +++ b/test/rulesets/LinearAlgebra/symmetric.jl @@ -305,7 +305,9 @@ U = Matrix(qr(randn(T, n, n)).Q) if hermout # f(A) will also be a TA λ = if f in (acos, asin, atanh) - 2 .* rand(real(T), n) .- 1 + # generate random number between -1 and 0.9. This would be between + # -1 and 1 but we want to avoid domain errors from numerical error + 1.9 .* rand(real(T), n) .- 1 elseif f in (log, sqrt) abs.(randn(real(T), n)) elseif f === acosh From acdb4c7020c2fa1ba8f7e0636dad2ef9acd6effa Mon Sep 17 00:00:00 2001 From: Lyndon White Date: Sat, 4 Dec 2021 09:13:00 -0600 Subject: [PATCH 2/2] type Co-authored-by: Michael Abbott <32575566+mcabbott@users.noreply.github.com> --- test/rulesets/LinearAlgebra/symmetric.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rulesets/LinearAlgebra/symmetric.jl b/test/rulesets/LinearAlgebra/symmetric.jl index e4e01d3d8..35e20fa96 100644 --- a/test/rulesets/LinearAlgebra/symmetric.jl +++ b/test/rulesets/LinearAlgebra/symmetric.jl @@ -307,7 +307,7 @@ λ = if f in (acos, asin, atanh) # generate random number between -1 and 0.9. This would be between # -1 and 1 but we want to avoid domain errors from numerical error - 1.9 .* rand(real(T), n) .- 1 + T(1.9) .* rand(real(T), n) .- 1 elseif f in (log, sqrt) abs.(randn(real(T), n)) elseif f === acosh