Skip to content

Rules for functions / structs etc #4

@willtebbutt

Description

@willtebbutt

The current design requires that rules have the form

function rrule(::typeof(foo), args...)
    ...
    return (rule_arg_1, rule_arg_2, ...)
end

I would like to propose to extend this to the following:

function rrule(foo::typeof(foo), args...)
    ...
    return (rule_foo, rule_arg_1, rule_arg_2, ...)
end

A lot of the time rule_foo will be a DNE, which is fine. However, if we're looking to implement rules for particular structs, then it may well be important to be able to represent the gradient w.r.t. the fields of the struct.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions