@@ -10,7 +10,6 @@ for f in
1010 :eig_trunc_no_error , :eigh_trunc_no_error ,
1111 :svd_compact , :svd_trunc , :svd_trunc_no_error , :svd_vals ,
1212 :left_polar , :right_polar ,
13- :project_hermitian , :project_antihermitian , :project_isometric ,
1413 )
1514 copy_f = Symbol (:cr_copy_ , f)
1615 f! = Symbol (f, ' !' )
@@ -599,47 +598,14 @@ function test_chainrules_projections(
599598 return @testset " Projections Chainrules AD rules $summary_str " begin
600599 A = instantiate_matrix (T, sz)
601600 m, n = size (A)
602- config = Zygote. ZygoteRuleConfig ()
603601 if m == n
604- alg_h = MatrixAlgebraKit. default_hermitian_algorithm (A)
605602 @testset " project_hermitian" begin
606- Aₕ, ΔAₕ = ad_project_hermitian_setup (A)
607- test_rrule (
608- cr_copy_project_hermitian, A, alg_h ⊢ NoTangent ();
609- output_tangent = ΔAₕ, atol = atol, rtol = rtol
610- )
611- test_rrule (
612- config, project_hermitian, A;
613- output_tangent = ΔAₕ,
614- atol = atol, rtol = rtol, rrule_f = rrule_via_ad, check_inferred = false
615- )
603+ alg = MatrixAlgebraKit. default_hermitian_algorithm (A)
604+ test_rrule (project_hermitian, A, alg; atol, rtol)
616605 end
617606 @testset " project_antihermitian" begin
618- Aₐ, ΔAₐ = ad_project_antihermitian_setup (A)
619- test_rrule (
620- cr_copy_project_antihermitian, A, alg_h ⊢ NoTangent ();
621- output_tangent = ΔAₐ, atol = atol, rtol = rtol
622- )
623- test_rrule (
624- config, project_antihermitian, A;
625- output_tangent = ΔAₐ,
626- atol = atol, rtol = rtol, rrule_f = rrule_via_ad, check_inferred = false
627- )
628- end
629- end
630- if m > n
631- @testset " project_isometric" begin
632- W, ΔW = ad_project_isometric_setup (A)
633- alg_iso = MatrixAlgebraKit. default_polar_algorithm (A)
634- test_rrule (
635- cr_copy_project_isometric, A, alg_iso ⊢ NoTangent ();
636- output_tangent = ΔW, atol = atol, rtol = rtol
637- )
638- test_rrule (
639- config, project_isometric, A;
640- output_tangent = ΔW,
641- atol = atol, rtol = rtol, rrule_f = rrule_via_ad, check_inferred = false
642- )
607+ alg = MatrixAlgebraKit. default_hermitian_algorithm (A)
608+ test_rrule (project_antihermitian, A, alg; atol, rtol)
643609 end
644610 end
645611 end
0 commit comments