# Path: tensorflow_constrained_optimization/python/constrained_minimization_problem.py
# class ConstrainedMinimizationProblem(tf.Module):
#   def __init__(self, name=None):
#   def objective(self):
#   def num_constraints(self):
#   def constraints(self):
#   def proxy_constraints(self):
#   def components(self):
#   def update_ops(self):


import abc
import six
import tensorflow as tf
from tensorflow_constrained_optimization.python import constrained_minimization_problem
    formulation (e.g. the Lagrange multipliers, for the Lagrangian formulation).

    Inside apply_gradients(), the state gradient will be dispatched to the
    appropriate contained optimizer (i.e. either the "optimizer" or
    "constrained_optimizer"), and optionally projected, in the
    _resource_apply_{dense,sparse}() methods.

    If "loss" is *not* a `ConstrainedMinimizationProblem`, then this function
    will thunk down to the _compute_gradients() method of the contained
    "optimizer".

    Args:
      loss: either a `ConstrainedMinimizationProblem`, or, if we do not wish to
        perform constrained optimization, a loss `Tensor` (in graph mode) or a
        nullary function returning a loss `Tensor` (in eager mode). In the two
        latter cases, this function will thunk down to the _compute_gradients()
        method of the contained "optimizer".
      var_list: as in `tf.keras.optimizers.Optimizer`.
      grad_loss: as in `tf.keras.optimizers.Optimizer`.
      tape: as in `tf.keras.optimizers.Optimizer`.

    Returns:
      A list of (gradient, variable) pairs, as in the _compute_gradients()
      method of `tf.keras.optimizers.Optimizer`.

    Raises:
      RuntimeError: if we don't know the number of constraints (e.g. from the
        num_constraints() setter).
    """
    if not isinstance(

# Path: tensorflow_constrained_optimization/python/constrained_minimization_problem.py
# class ConstrainedMinimizationProblem(tf.Module):
#   def __init__(self, name=None):
#   def objective(self):
#   def num_constraints(self):
#   def constraints(self):
#   def proxy_constraints(self):
#   def components(self):
#   def update_ops(self):


# Path: tensorflow_constrained_optimization/python/train/constrained_optimizer.py
import abc
import six
import tensorflow as tf
from tensorflow_constrained_optimization.python import constrained_minimization_problem

    formulation (e.g. the Lagrange multipliers, for the Lagrangian formulation).

    Inside apply_gradients(), the state gradient will be dispatched to the
    appropriate contained optimizer (i.e. either the "optimizer" or
    "constrained_optimizer"), and optionally projected, in the
    _resource_apply_{dense,sparse}() methods.

    If "loss" is *not* a `ConstrainedMinimizationProblem`, then this function
    will thunk down to the _compute_gradients() method of the contained
    "optimizer".

    Args:
      loss: either a `ConstrainedMinimizationProblem`, or, if we do not wish to
        perform constrained optimization, a loss `Tensor` (in graph mode) or a
        nullary function returning a loss `Tensor` (in eager mode). In the two
        latter cases, this function will thunk down to the _compute_gradients()
        method of the contained "optimizer".
      var_list: as in `tf.keras.optimizers.Optimizer`.
      grad_loss: as in `tf.keras.optimizers.Optimizer`.
      tape: as in `tf.keras.optimizers.Optimizer`.

    Returns:
      A list of (gradient, variable) pairs, as in the _compute_gradients()
      method of `tf.keras.optimizers.Optimizer`.

    Raises:
      RuntimeError: if we don't know the number of constraints (e.g. from the
        num_constraints() setter).
    """
    if not isinstance(

        loss, constrained_minimization_problem.ConstrainedMinimizationProblem):