# tf.compat.v1.data.get_output_classes

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.13.1/tensorflow/python/data/ops/dataset_ops.py#L4362-L4381) |

Returns the output classes for elements of the input dataset / iterator.

    tf.compat.v1.data.get_output_classes(
        dataset_or_iterator
    )

<br />

## Migrate to TF2

<br />

> [!CAUTION]
> **Caution:** This API was designed for TensorFlow v1. Continue reading for details on how to migrate from this API to a native TensorFlow v2 equivalent. See the [TensorFlow v1 to TensorFlow v2 migration guide](https://www.tensorflow.org/guide/migrate) for instructions on how to migrate the rest of your code.

This is a legacy API for inspecting the type signature of dataset elements. In
TF 2, you should use the [`tf.data.Dataset.element_spec`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/data/Dataset#element_spec) attribute instead.

<br />

<br />

## Description

<br />

<br />

<br />

| ## Args ||
|---|---|
| `dataset_or_iterator` | A [`tf.data.Dataset`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/data/Dataset) or [`tf.data.Iterator`](https://www.tensorflow.org/versions/r2.13/api_docs/python/tf/data/Iterator). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A (nested) structure of Python `type` objects matching the structure of the dataset / iterator elements and specifying the class of the individual components. ||

<br />