The intro tutorial, which uses the built-in gradient descent optimizer, makes a lot of sense. However, k-means isn\'t just something I can plug into gradient descent. It seems l
Nowadays you could directly use (or take inspiration from) the KMeansClustering Estimator. You can take a look at its implementation on GitHub.