@@ -43,11 +43,10 @@ for qr_f in (:qr_compact, :qr_full)
4343end
4444function ChainRulesCore. rrule (:: typeof (qr_null!), A:: AbstractMatrix , N, alg)
4545 Ac = copy_input (qr_full, A)
46- QR = qr_full! (Ac, initialize_output (qr_full!, A, alg), alg)
47- N = copy! (N, view (QR[1 ], 1 : size (A, 1 ), (size (A, 2 ) + 1 ): size (A, 1 )))
46+ N = qr_null! (Ac, N, alg)
4847 function qr_null_pullback (ΔN)
4948 ΔA = zero (A)
50- MatrixAlgebraKit. qr_null_pullback! (ΔA, A, QR , unthunk (ΔN))
49+ MatrixAlgebraKit. qr_null_pullback! (ΔA, A, N , unthunk (ΔN))
5150 return NoTangent (), ΔA, ZeroTangent (), NoTangent ()
5251 end
5352 function qr_null_pullback (:: ZeroTangent ) # is this extra definition useful?
@@ -76,11 +75,10 @@ for lq_f in (:lq_compact, :lq_full)
7675end
7776function ChainRulesCore. rrule (:: typeof (lq_null!), A:: AbstractMatrix , Nᴴ, alg)
7877 Ac = copy_input (lq_full, A)
79- LQ = lq_full! (Ac, initialize_output (lq_full!, A, alg), alg)
80- Nᴴ = copy! (Nᴴ, view (LQ[2 ], (size (A, 1 ) + 1 ): size (A, 2 ), 1 : size (A, 2 )))
78+ Nᴴ = lq_null! (Ac, Nᴴ, alg)
8179 function lq_null_pullback (ΔNᴴ)
8280 ΔA = zero (A)
83- MatrixAlgebraKit. lq_null_pullback! (ΔA, A, LQ , unthunk (ΔNᴴ))
81+ MatrixAlgebraKit. lq_null_pullback! (ΔA, A, Nᴴ , unthunk (ΔNᴴ))
8482 return NoTangent (), ΔA, ZeroTangent (), NoTangent ()
8583 end
8684 function lq_null_pullback (:: ZeroTangent ) # is this extra definition useful?
0 commit comments