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

Commit c2736d4

Browse files
authored
Remove @differentiable attribute from Layer.inferring(from:). (#575)
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 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.
1 parent 8c03e44 commit c2736d4

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)