# tfdv.validate_corresponding_slices

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/data-validation/blob/v1.16.1/tensorflow_data_validation/api/validation_api.py#L938-L982) |

Validates corresponding sliced statistics.

    tfdv.validate_corresponding_slices(
        statistics: statistics_pb2.DatasetFeatureStatisticsList,
        schema: schema_pb2.Schema,
        environment: Optional[Text] = None,
        previous_statistics: Optional[statistics_pb2.DatasetFeatureStatisticsList] = None,
        serving_statistics: Optional[statistics_pb2.DatasetFeatureStatisticsList] = None
    ) -> anomalies_pb2.Anomalies

Sliced statistics are flattened into a single unsliced stats input prior to
validation. If multiple statistics are provided, validation is performed on
corresponding slices. DatasetConstraints, if present, are applied to the
overall slice.

> [!NOTE]
> **Note:** This API is experimental and subject to change.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `statistics` | See validate_statistics. |
| `schema` | See validate_statistics. |
| `environment` | See validate_statistics. |
| `previous_statistics` | See validate_statistics. |
| `serving_statistics` | See validate_statistics. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| An Anomalies protocol buffer. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If any of the input arguments is not of the expected type. |

<br />