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

Commit aef14a0

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. Otherwise, the `@differentiable` attribute will trigger differentiation for `Layer.inferring(from:)`, leading to a non-differentiability error.
1 parent 8c03e44 commit aef14a0

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)