Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/rulesets/LinearAlgebra/factorization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -578,3 +578,11 @@ function _x_divide_conj_y(x, y)
z = x / conj(y)
return iszero(x) ? zero(z) : z
end

# Support both factors and U / L properties on cholesky tangent types
# TOODO: Maybe we should check the type of U or L first?
function Base.getproperty(tangent::Tangent{P, T}, sym::Symbol) where {P <: Cholesky, T <: NamedTuple}
idx = if hasfield(T, :factors) && sym in (:U, :L) ? :factors : sym
hasfield(T, idx) || return ZeroTangent()
return unthunk(getfield(ChainRulesCore.backing(tangent), idx))
end