Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.

Remove @differentiable attribute from Layer.inferring(from:). #575

Merged
merged 1 commit into from
Dec 6, 2019

Conversation

dan-zheng
Copy link
Member

@dan-zheng dan-zheng commented Dec 6, 2019

Necessary for TF-835: lowering @derivative attribute directly to SIL
differentiability witnesses instead of creating implicit @differentiable
attributes.

@differentiable + @derivative attributes for the same original declaration
with the same wrt parameters will be diagnosed:

/Users/danielzheng/swift-bart/tensorflow-swift-apis/Sources/TensorFlow/Layer.swift:94:6: error: a derivative already exists for 'inferring(from:)'
    @derivative(of: inferring(from:))
    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/danielzheng/swift-bart/tensorflow-swift-apis/Sources/TensorFlow/Layer.swift:88:6: note: other attribute declared here
    @differentiable
     ^

This is already done for @differentiable + @differentiable and
@derivative + @derivative combinations. Derivative generic signature
mangling is necessary to lift this limitation: .

To relax this limitation, derivative generic signature mangling (TF-680) is
necessary to avoid name collisions for SIL derivative functions with the same
parameter indices but different derivative generic signatures.

Necessary for TF-835: lowering `@derivative` attribute directly to SIL
differentiability witnesses instead of creating implicit `@differentiable`
attributes.

`@differentiable` + `@derivative` attributes for the same original declaration
with the same wrt parameters will be diagnosed.

To lift this limitation, derivative generic signature mangling (TF-680) is
necessary to avoid name collisions for SIL derivative functions with the same
parameter indices but different derivative generic signatures.
@dan-zheng dan-zheng merged commit c2736d4 into tensorflow:master Dec 6, 2019
@dan-zheng dan-zheng deleted the TF-835 branch December 6, 2019 16:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants