<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/neural-structured-learning/blob/v1.4.0/neural_structured_learning/lib/utils.py#L456-L475) |

Applies a feature mask on `features` if the `feature_mask` is not `None`.

    nsl.lib.apply_feature_mask(
        features, feature_mask=None
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `features` | A dense tensor representing features. |
| `feature_mask` | A dense tensor with values in `[0, 1]` and a broadcastable shape to `features`. If not set, or set to `None`, the `features` are returned unchanged. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A dense tensor having the same shape as `features`. ||

<br />