From a275f1ff33a6ef20613803e6475750e5d93fbdd2 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 22 Nov 2023 10:49:18 -0500 Subject: [PATCH] Update src/rulesets/LinearAlgebra/structured.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/rulesets/LinearAlgebra/structured.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rulesets/LinearAlgebra/structured.jl b/src/rulesets/LinearAlgebra/structured.jl index 705c372da..d2ecdaba9 100644 --- a/src/rulesets/LinearAlgebra/structured.jl +++ b/src/rulesets/LinearAlgebra/structured.jl @@ -276,8 +276,12 @@ end function rrule(::Type{Tridiagonal}, dl, d, du) y = Tridiagonal(dl, d, du) @views function ∇Tridiagonal(∂y) - return (NoTangent(), diag(∂y[2:end, 1:(end - 1)]), diag(∂y), - diag(∂y[1:(end - 1), 2:end])) + return ( + NoTangent(), + diag(∂y[2:end, 1:(end - 1)]), + diag(∂y), + diag(∂y[1:(end - 1), 2:end]), + ) end return y, ∇Tridiagonal end