tf.compat.v1.flags.register_validator

Adds a constraint, which will be enforced during program execution.