``public protocol Differentiable``

A type that mathematically represents a differentiable manifold whose tangent spaces are finite-dimensional.

• ``` TangentVector ```

The tangent bundle of this differentiable manifold.

#### Declaration

``associatedtype TangentVector``
• ``` CotangentVector ```

The cotangent bundle of this differentiable manifold.

#### Declaration

``associatedtype CotangentVector``
• ``` AllDifferentiableVariables ```

The type of all differentiable variables in this type.

#### Declaration

``associatedtype AllDifferentiableVariables``
• ``` allDifferentiableVariables ``` Default implementation

All differentiable variables in this value.

#### Declaration

``var allDifferentiableVariables: AllDifferentiableVariables { get }``
• ``` moved(along:) ``` Default implementation

Returns `self` moved along the value space towards the given tangent vector. In Riemannian geometry (mathematics), this represents an exponential map.

#### Declaration

``func moved(along direction: TangentVector) -> Self``
• ``` tangentVector(from:) ```

Convert a cotangent vector to its corresponding tangent vector.

#### Declaration

``func tangentVector(from cotangent: CotangentVector) -> TangentVector``
• ``` withoutDerivative() ``` Extension method

Identity function that stops gradients from propagating.

#### Declaration

``````@_semantics("autodiff.nonvarying")
func withoutDerivative() -> Self``````
• ``` withGradient(_:) ``` Extension method

#### Declaration

``func withGradient(_ body: @escaping (inout CotangentVector) -> Void) -> Self``
• ``` withGradient(_:) ``` Extension method

#### Declaration

``func withGradient(_ body: @escaping (CotangentVector) -> Void) -> Self``
• ``` withRecomputationInPullbacks(_:) ``` Extension method

#### Declaration

``````func withRecomputationInPullbacks<Result : Differentiable>(
_ body: @escaping @differentiable (Self) -> Result
) -> Result``````
• ``` valueWithPullback(in:) ``` Extension method

#### Declaration

``````func valueWithPullback<R : Differentiable>(
in f: @differentiable (Self) -> R
) -> (value: R, pullback: (R.CotangentVector) -> CotangentVector)``````
• ``` pullback(in:) ``` Extension method

#### Declaration

``````func pullback<R : Differentiable>(
in f: @differentiable (Self) -> R
) -> (R.CotangentVector) -> CotangentVector``````
• ``` gradient(in:) ``` Extension method

#### Declaration

``````func gradient<R : Differentiable>(
in f: @differentiable (Self) -> R
) -> CotangentVector
where R : FloatingPoint, R.CotangentVector == R``````
• ``` valueWithGradient(in:) ``` Extension method

#### Declaration

``````func valueWithGradient<R : Differentiable>(
in f: @differentiable (Self) -> R
) -> (value: R, gradient: CotangentVector)
where R : FloatingPoint, R.CotangentVector == R``````
• ``` valueWithPullback(at:in:) ``` Extension method

#### Declaration

``````func valueWithPullback<T : Differentiable, R : Differentiable>(
at x: T, in f: @differentiable (Self, T) -> R
) -> (value: R,
pullback: (R.CotangentVector) -> (CotangentVector, T.CotangentVector))``````
• ``` pullback(at:in:) ``` Extension method

#### Declaration

``````func pullback<T : Differentiable, R : Differentiable>(
at x: T, in f: @differentiable (Self, T) -> R
) -> (R.CotangentVector) -> (CotangentVector, T.CotangentVector)``````
• ``` gradient(at:in:) ``` Extension method

#### Declaration

``````func gradient<T : Differentiable, R : Differentiable>(
at x: T, in f: @differentiable (Self, T) -> R
) -> (CotangentVector, T.CotangentVector)
where R : FloatingPoint, R.CotangentVector == R``````
• ``` valueWithGradient(at:in:) ``` Extension method

#### Declaration

``````func valueWithGradient<T : Differentiable, R : Differentiable>(
at x: T, in f: @differentiable (Self, T) -> R
) -> (value: R, gradient: (CotangentVector, T.CotangentVector))
where R : FloatingPoint, R.CotangentVector == R``````
• ``` gradient(in:) ``` Extension method

#### Declaration

``````func gradient<R : TensorFlowFloatingPoint>(
in f: @differentiable (Self) -> Tensor<R>
) -> CotangentVector``````
• ``` valueWithGradient(in:) ``` Extension method

#### Declaration

``````func valueWithGradient<R : TensorFlowFloatingPoint>(
in f: @differentiable (Self) -> Tensor<R>
) -> (value: Tensor<R>, gradient: CotangentVector)``````
• ``` gradient(at:in:) ``` Extension method

#### Declaration

``````func gradient<T : Differentiable, R : TensorFlowFloatingPoint>(
at x: T, in f: @differentiable (Self, T) -> Tensor<R>
) -> (CotangentVector, T.CotangentVector)``````
• ``` valueWithGradient(at:in:) ``` Extension method

#### Declaration

``````func valueWithGradient<T : Differentiable, R : TensorFlowFloatingPoint>(
at x: T, in f: @differentiable (Self, T) -> Tensor<R>
) -> (value: Tensor<R>, gradient: (CotangentVector, T.CotangentVector))``````
• ``` sequenced(through:_:) ``` Extension method

Returns the output computed by applying a sequence of layers to the previous layer’s output, except that the first layer’s input is `self`.

#### Declaration

``````func sequenced<L1: Layer, L2: Layer>(through l1: L1, _ l2: L2) -> L2.Output
where L1.Input == Self, L1.Output == L2.Input``````

#### Parameters

 ``` l1 ``` The first layer. ``` l2 ``` The second layer.

#### Return Value

The final layer’s output after sequential application.

• ``` sequenced(through:_:_:) ``` Extension method

Returns the output computed by applying a sequence of layers to the previous layer’s output, except that the first layer’s input is `self`.

#### Declaration

``````func sequenced<L1: Layer, L2: Layer, L3: Layer>(through l1: L1, _ l2: L2, _ l3: L3) -> L3.Output
where L1.Input == Self, L1.Output == L2.Input, L2.Output == L3.Input``````

#### Parameters

 ``` l1 ``` The first layer. ``` l2 ``` The second layer. ``` l3 ``` The third layer.

#### Return Value

The final layer’s output after sequential application.

• ``` sequenced(through:_:_:_:) ``` Extension method

Returns the output computed by applying a sequence of layers to the previous layer’s output, except that the first layer’s input is `self`.

#### Declaration

``````func sequenced<L1: Layer, L2: Layer, L3: Layer, L4: Layer>(
through l1: L1, _ l2: L2, _ l3: L3, _ l4: L4
) -> L4.Output
where L1.Input == Self, L1.Output == L2.Input, L2.Output == L3.Input,
L3.Output == L4.Input``````

#### Parameters

 ``` l1 ``` The first layer. ``` l2 ``` The second layer. ``` l3 ``` The third layer. ``` l4 ``` The fourth layer.

#### Return Value

The final layer’s output after sequential application.

• ``` sequenced(through:_:_:_:_:) ``` Extension method

Returns the output computed by applying a sequence of layers to the previous layer’s output, except that the first layer’s input is `self`.

#### Declaration

``````func sequenced<L1: Layer, L2: Layer, L3: Layer, L4: Layer, L5: Layer>(
through l1: L1, _ l2: L2, _ l3: L3, _ l4: L4, _ l5: L5
) -> L5.Output
where L1.Input == Self, L1.Output == L2.Input, L2.Output == L3.Input, L3.Output == L4.Input,
L4.Output == L5.Input``````

#### Parameters

 ``` l1 ``` The first layer. ``` l2 ``` The second layer. ``` l3 ``` The third layer. ``` l4 ``` The third layer. ``` l5 ``` The fifth layer.

#### Return Value

The final layer’s output after sequential application.

• ``` sequenced(through:_:_:_:_:_:) ``` Extension method

Returns the output computed by applying a sequence of layers to the previous layer’s output, except that the first layer’s input is `self`.

#### Declaration

``````func sequenced<L1: Layer, L2: Layer, L3: Layer, L4: Layer, L5: Layer, L6: Layer>(
through l1: L1, _ l2: L2, _ l3: L3, _ l4: L4, _ l5: L5, _ l6: L6
) -> L6.Output
where L1.Input == Self, L1.Output == L2.Input, L2.Output == L3.Input, L3.Output == L4.Input,
L4.Output == L5.Input, L5.Output == L6.Input``````

#### Parameters

 ``` l1 ``` The first layer. ``` l2 ``` The second layer. ``` l3 ``` The third layer. ``` l4 ``` The third layer. ``` l5 ``` The fifth layer. ``` l6 ``` The sixth layer.

#### Return Value

The final layer’s output after sequential application.