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

Commit ec16b6c

Browse files
committed
Make derivatives of public functions be @usableFromInline.
1 parent 5bc6e87 commit ec16b6c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Sources/TensorFlow/Core/MixedPrecision.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@ extension Tensor {
206206
#endif
207207

208208
extension Tensor where Scalar: TensorFlowFloatingPoint {
209+
@usableFromInline
209210
@derivative(of: toReducedPrecision)
210211
func _vjpToReducedPrecision() -> (value: Tensor, pullback: (Tensor) -> Tensor) {
211212
(toReducedPrecision, { $0.toFullPrecision })
212213
}
213214

215+
@usableFromInline
214216
@derivative(of: toFullPrecision)
215217
func _vjpToFullPrecision() -> (value: Tensor, pullback: (Tensor) -> Tensor) {
216218
(toFullPrecision, { $0.toReducedPrecision })

Sources/TensorFlow/Layer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ extension Layer {
9494

9595
// TODO(TF-433, SR-11882): Remove this custom derivative when
9696
// differentiation supports `rethrows` functions and currying.
97-
@derivative(of: inferring(from:))
9897
@usableFromInline
98+
@derivative(of: inferring(from:))
9999
internal func _vjpInferring(from input: Input)
100100
-> (
101101
value: Output,

0 commit comments

Comments
 (0)