Imported from https://github.com/google-research/tensorflow_constrained_optimization
