Open
Description
Can we safely detect if a primal function is going to hit a specific default and use that to change the logic in the frule
or rrule
?
For example, the rrule
for det(A)
calls inv(A)
. If we know that the primal function that would be hit is the det(A::AbstractMatrix)
definition in generic.jl
, then we know that the primal is using the lu
decomposition to compute the determinant, and we can reuse that to compute the inverse faster. But if a specialized primal method was being hit, then we probably just want to call the primal and invert separately since that primal is probably more efficient for that type than lu
.