Returns the output classes of a `Dataset` or `Iterator` elements. This utility method replaces the deprecated-in-V2 `tf.compat.v1.Dataset.output_classes` property. Args: dataset_or_iterator: A `tf.data.Dataset` or `tf.data.IteratorV2`. Returns: A nested structure of Python `type`
(dataset_or_iterator)
| 2235 | |
| 2236 | @tf_export(v1=["data.get_output_classes"]) |
| 2237 | def get_legacy_output_classes(dataset_or_iterator): |
| 2238 | """Returns the output classes of a `Dataset` or `Iterator` elements. |
| 2239 | |
| 2240 | This utility method replaces the deprecated-in-V2 |
| 2241 | `tf.compat.v1.Dataset.output_classes` property. |
| 2242 | |
| 2243 | Args: |
| 2244 | dataset_or_iterator: A `tf.data.Dataset` or `tf.data.IteratorV2`. |
| 2245 | |
| 2246 | Returns: |
| 2247 | A nested structure of Python `type` objects matching the structure of the |
| 2248 | dataset / iterator elements and specifying the class of the individual |
| 2249 | components. |
| 2250 | """ |
| 2251 | return nest.map_structure( |
| 2252 | lambda component_spec: component_spec._to_legacy_output_classes(), # pylint: disable=protected-access |
| 2253 | get_structure(dataset_or_iterator)) |
| 2254 | |
| 2255 | |
| 2256 | @tf_export(v1=["data.get_output_shapes"]) |
no test coverage detected