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

Commit 6c3a583

Browse files
committed
Remove @differentiable attribute from Layer.inferring(from:).
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. This is already done for `@differentiable` + `@differentiable` and `@derivative` + `@derivative` combinations. Derivative generic signature mangling is necessary to lift this limitation: TF-680.
1 parent 8c03e44 commit 6c3a583

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/TensorFlow/Layer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ public extension Layer {
8585
///
8686
/// - Parameter input: The input to the layer.
8787
/// - Returns: The inference output.
88-
@differentiable
8988
func inferring(from input: Input) -> Output {
9089
withLearningPhase(LearningPhase.inference) { self(input) }
9190
}
9291

93-
// TODO(rxwei): Remove this custom VJP once differentiation supports currying.
92+
// TODO(TF-433, SR-11882): Remove this custom derivative when
93+
// differentiation supports `rethrows` functions and currying.
9494
@derivative(of: inferring(from:))
9595
@usableFromInline
9696
internal func _vjpInferring(from input: Input)

0 commit comments

Comments
 (0)