You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, `@scalar_rule` generates `rrule` methods with no type
constraints. This poses a problem for rules with different definitions
that have not yet been implemented. For example, the rule for matrix
exponential is quite different from that for scalar exponential, but in
the absence of an `rrule(::typeof(exp), ::AbstractMatrix)` method, the
incorrect fallback generated by `@scalar_rule` is used.
To solve this, `@scalar_rule` now allows type constaints, e.g.
`@scalar_rule(f(x::Complex), g(x))`, and it adds explicit `::Number`
constraints to the generated methods if no such constraints are
provided.
0 commit comments