Skip to content

Can rules make decisions based on which primal method is used? #237

Open
@sethaxen

Description

@sethaxen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designRequires some design before changes are madetype constraintsPotentially raises a question about how tightly to constrain argument types for a rule. See #232

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions