Skip to content
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sources/TensorFlow/Operators/Math.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func pow<T: BinaryFloatingPoint>(_ x: T, _ y: T) -> T {
//===------------------------------------------------------------------------------------------===//

extension Tensor: VectorProtocol where Scalar: Numeric {
public typealias VectorSpaceScalar = Scalar

/// Multiplies the scalar with every scalar of the tensor and produces the product.
@inlinable
@differentiable(vjp: _vjpMultiply(lhs:rhs:) where Scalar: TensorFlowFloatingPoint)
Expand Down
2 changes: 1 addition & 1 deletion Sources/TensorFlow/Optimizer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public class SGD<Model: Layer>: Optimizer

/// A Riemann manifold stochastic gradient descent (SGD) optimizer.
public class RiemannSGD<Model: Layer, Scalar: FloatingPoint>: Optimizer
where Model.TangentVector: VectorProtocol, Model.TangentVector.Scalar == Scalar {
where Model.TangentVector: VectorProtocol, Model.TangentVector.VectorSpaceScalar == Scalar {
/// The learning rate.
public var learningRate: Scalar

Expand Down