 /// `1 - cosineSimilarity(x, y)`.
 @differentiable
 public func cosineDistance<Scalar: TensorFlowFloatingPoint>(
-    _ x: Tensor<Scalar>, _ y: Tensor<Scalar>
+    _ x: Tensor<Scalar>,
+    _ y: Tensor<Scalar>
 ) -> Tensor<Scalar> {
     1 - cosineSimilarity(x, y)
 }

/// Returns the cosine similarity between `x` and `y`.
@differentiable
public func cosineSimilarity<Scalar: TensorFlowFloatingPoint>(
    _ x: Tensor<Scalar>, _ y: Tensor<Scalar>
) -> Tensor<Scalar> {
    (x * y).sum() / (sqrt(x.squared().sum()) * sqrt(y.squared().sum()))
}


@inlinable
internal func _vjpMax<T: TensorFlowFloatingPoint>(
    _ x: Tensor<T>,
    _ y: Tensor<T>
) -> (Tensor<T>, (Tensor<T>) -> (Tensor<T>, Tensor<T>)) {
    let value = max(x, y)
    return (value, { v in _vjpMinMaxHelper(x, y, originalValue: value, seed: v) })
