# tfl.pwl_calibration_lib.assert_constraints

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/lattice/blob/v2.1.1/tensorflow_lattice/python/pwl_calibration_lib.py#L805-L885) |

Asserts that 'outputs' satisfiy constraints.

    tfl.pwl_calibration_lib.assert_constraints(
        outputs,
        monotonicity,
        output_min,
        output_max,
        clamp_min=False,
        clamp_max=False,
        debug_tensors=None,
        eps=1e-06
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `outputs` | Tensor of shape `(num_output_values, units)` which represents outputs of pwl calibration layer which will be tested against the given constraints. If monotonicity is specified these outputs must be for consequtive inputs. |
| `monotonicity` | One of {-1, 0, 1}. -1 for decreasing, 1 for increasing 0 means no monotonicity checks. |
| `output_min` | Lower bound or None. |
| `output_max` | Upper bound or None. |
| `clamp_min` | Whether one of outputs must match output_min. |
| `clamp_max` | Whther one of outputs must match output_max. |
| `debug_tensors` | None or list of anything convertible to tensor (for example tensors or strings) which will be printed in case of constraints violation. |
| `eps` | Allowed constraints violation. |

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | If monotonicity is not one of {-1, 0, 1} |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| List of assertion ops in graph mode or immideately asserts in eager mode. ||

<br />