   return { x, y in valueWithGradient(at: x, y, in: f) }
 }
 
-// @inlinable
-// public func valueWithGradient<T, U, V, R>(
-//     of f: @escaping @differentiable (T, U, V) -> Tensor<R>
-// ) -> (T, U, V) -> (
-//     value: Tensor<R>,
-//     gradient: (T.TangentVector, U.TangentVector, V.TangentVector))
-//     where T: Differentiable, U: Differentiable, V: Differentiable, R: TensorFlowFloatingPoint {
-//   return { x, y, z in valueWithGradient(at: x, y, z, in: f) }
-// }
+@inlinable
+public func valueWithGradient<T, U, V, R>(
+    of f: @escaping @differentiable (T, U, V) -> Tensor<R>
+) -> (T, U, V) -> (
+    value: Tensor<R>,
+    gradient: (T.TangentVector, U.TangentVector, V.TangentVector))
+    where T: Differentiable, U: Differentiable, V: Differentiable, R: TensorFlowFloatingPoint {
+  return { x, y, z in valueWithGradient(at: x, y, z, in: f) }
+}
 
 // Gradient
 

    return (y, pullback(Tensor<R>(1)))
}

// @inlinable
// public func valueWithGradient<T, U, V, R>(
//     at x: T,
//     _ y: U,
//     _ z: V,
//     in f: @differentiable (T, U, V) -> Tensor<R>
// ) -> (value: Tensor<R>, gradient: (T.TangentVector, U.TangentVector, V.TangentVector))
//   where T: Differentiable, U: Differentiable, V: Differentiable, R: TensorFlowFloatingPoint {
//   let (y, pullback) = valueWithPullback(at: x, y, z, in: f)
//   precondition(y.rank == 0)
//   return (y, pullback(Tensor<R>(1)))
// }

// Value with gradient (curried)


    return valueWithGradient(at: x, y, in: f).1
}

@inlinable
public func gradient<T, U, V, R>(
    at x: T,
    _ y: U,
    _ z: V,
    in f: @differentiable (T, U, V) -> Tensor<R>
) -> (T.TangentVector, U.TangentVector, V.TangentVector)
    where T: Differentiable, U: Differentiable, V: Differentiable, R: TensorFlowFloatingPoint {
    return valueWithGradient(at: x, y, z, in: f).1
}

// Gradient (curried)

