@@ -13,27 +13,24 @@ eltypes = (Float64, ComplexF64)
1313 atol = default_tol (T)
1414 rtol = default_tol (T)
1515
16- # S = svd_vals(t)
17- # EnzymeTestUtils.test_reverse(svd_vals, Duplicated, (t, Duplicated); atol, rtol)
16+ S = svd_vals (t)
17+ EnzymeTestUtils. test_reverse (svd_vals, Duplicated, (t, Duplicated); atol, rtol)
1818
1919 USVᴴ = svd_full (t)
2020 ΔUSVᴴ = EnzymeTestUtils. rand_tangent (USVᴴ)
2121 remove_svd_gauge_dependence! (ΔUSVᴴ[1 ], ΔUSVᴴ[3 ], USVᴴ... )
2222 EnzymeTestUtils. test_reverse (svd_full, Duplicated, (t, Duplicated); output_tangent = ΔUSVᴴ, atol, rtol)
2323
24- # ntuple related bug in Enzyme internals
25- @static if VERSION >= v " 1.11.0-rc"
26- USVᴴ = svd_compact (t)
27- ΔUSVᴴ = EnzymeTestUtils. rand_tangent (USVᴴ)
28- remove_svd_gauge_dependence! (ΔUSVᴴ[1 ], ΔUSVᴴ[3 ], USVᴴ... )
29- EnzymeTestUtils. test_reverse (svd_compact, Duplicated, (t, Duplicated); output_tangent = ΔUSVᴴ, atol, rtol)
24+ USVᴴ = svd_compact (t)
25+ ΔUSVᴴ = EnzymeTestUtils. rand_tangent (USVᴴ)
26+ remove_svd_gauge_dependence! (ΔUSVᴴ[1 ], ΔUSVᴴ[3 ], USVᴴ... )
27+ EnzymeTestUtils. test_reverse (svd_compact, Duplicated, (t, Duplicated); output_tangent = ΔUSVᴴ, atol, rtol)
3028
31- V_trunc = spacetype (t)(c => min (size (b)... ) ÷ 2 for (c, b) in blocks (t))
32- trunc = truncspace (V_trunc)
33- alg = MatrixAlgebraKit. select_algorithm (svd_trunc_no_error, t, nothing ; trunc)
34- USVᴴtrunc = svd_trunc_no_error (t, alg)
35- ΔUSVᴴtrunc = EnzymeTestUtils. rand_tangent (USVᴴtrunc)
36- remove_svd_gauge_dependence! (ΔUSVᴴtrunc[1 ], ΔUSVᴴtrunc[3 ], USVᴴtrunc... )
37- EnzymeTestUtils. test_reverse (svd_trunc_no_error, Duplicated, (t, Duplicated), (alg, Const); output_tangent = ΔUSVᴴtrunc, atol, rtol)
38- end
29+ V_trunc = spacetype (t)(c => min (size (b)... ) ÷ 2 for (c, b) in blocks (t))
30+ trunc = truncspace (V_trunc)
31+ alg = MatrixAlgebraKit. select_algorithm (svd_trunc_no_error, t, nothing ; trunc)
32+ USVᴴtrunc = svd_trunc_no_error (t, alg)
33+ ΔUSVᴴtrunc = EnzymeTestUtils. rand_tangent (USVᴴtrunc)
34+ remove_svd_gauge_dependence! (ΔUSVᴴtrunc[1 ], ΔUSVᴴtrunc[3 ], USVᴴtrunc... )
35+ EnzymeTestUtils. test_reverse (svd_trunc_no_error, Duplicated, (t, Duplicated), (alg, Const); output_tangent = ΔUSVᴴtrunc, atol, rtol)
3936end
0 commit comments