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
dan-zheng opened this issue
Dec 6, 2019
· 0 comments
Labels
attributesFeature: Declaration and type attributesAutoDiffclassFeature → type declarations: Class declarationscompilerThe Swift compiler itselffeatureA feature request or implementationmethodsFeature → functions: methods (member functions)
@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.
The text was updated successfully, but these errors were encountered:
attributesFeature: Declaration and type attributesAutoDiffclassFeature → type declarations: Class declarationscompilerThe Swift compiler itselffeatureA feature request or implementationmethodsFeature → functions: methods (member functions)
Additional Detail from JIRA
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.The text was updated successfully, but these errors were encountered: