-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Description
Previous ID | SR-12156 |
Radar | None |
Original Reporter | @dan-zheng |
Type | Sub-task |
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Sub-task |
Assignee | None |
Priority | Medium |
md5: 5db9c5c7c42530ea5694370955eac541
Issue Description:
@differentiable
attribute on class methods currently does two orthogonal things:
-
Requests derivative generation for the class method.
-
Adds JVP/VJP vtable entries for the class method.
There's currently no way using @differentiable
to do only one of the above. There may be use cases for doing only one of the above:
-
Adding JVP/VJP vtable entries + custom derivative registration via
@derivative
attribute (no derivative generation). -
Requesting derivative generation without JVP/VJP vtable entries? Maybe there's no use for this.
Supporting this may require new attribute syntax.
Note that this issue does not occur for protocol requirements, where @differentiable
attribute can only mean one thing: add JVP/VJP witness table entries (and require implementations to specify same @differentiable
attribute). This is because they have no function body for derivative generation.