# tfl.linear_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/linear_lib.py#L114-L208) |

Asserts that weights satisfy constraints.

    tfl.linear_lib.assert_constraints(
        weights,
        monotonicities,
        monotonic_dominances,
        range_dominances,
        input_min,
        input_max,
        normalization_order,
        eps=0.0001
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `weights` | Weights of Linear layer. |
| `monotonicities` | List or tuple of same length as number of elements in 'weights' of {-1, 0, 1} which represent monotonicity constraints per dimension. -1 stands for decreasing, 0 for no constraints, 1 for increasing. |
| `monotonic_dominances` | List of two-element tuple. First element is the index of the dominant feature. Second element is the index of the weak feature. |
| `range_dominances` | List of two-element tuples. First element is the index of the dominant feature. Second element is the index of the weak feature. |
| `input_min` | List or tuple of length same length as number of elements in 'weights' of either None or float which specifies the minimum value to clip by. |
| `input_max` | List or tuple of length same length as number of elements in 'weights' of either None or float which specifies the maximum value to clip by. |
| `normalization_order` | Whether weights have to have norm 1. Norm will be computed by: [`tf.norm(tensor, ord=normalization_order)`](https://www.tensorflow.org/api_docs/python/tf/norm). |
| `eps` | Allowed constraints violation. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| List of assetion ops in graph mode or directly executes assertions in eager mode. ||

<br />