Skip to content

Commit

Permalink
Update src/rulesets/LinearAlgebra/structured.jl
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
ChrisRackauckas and github-actions[bot] authored Nov 22, 2023
1 parent 3459acb commit a275f1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/rulesets/LinearAlgebra/structured.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit a275f1f

Please sign in to comment.