Returns the output shapes of a `Dataset` or `Iterator` elements. This utility method replaces the deprecated-in-V2 `tf.compat.v1.Dataset.output_shapes` property. Args: dataset_or_iterator: A `tf.data.Dataset` or `tf.data.Iterator`. Returns: A nested structure of `tf.TensorShape` o
(dataset_or_iterator)
| 2255 | |
| 2256 | @tf_export(v1=["data.get_output_shapes"]) |
| 2257 | def get_legacy_output_shapes(dataset_or_iterator): |
| 2258 | """Returns the output shapes of a `Dataset` or `Iterator` elements. |
| 2259 | |
| 2260 | This utility method replaces the deprecated-in-V2 |
| 2261 | `tf.compat.v1.Dataset.output_shapes` property. |
| 2262 | |
| 2263 | Args: |
| 2264 | dataset_or_iterator: A `tf.data.Dataset` or `tf.data.Iterator`. |
| 2265 | |
| 2266 | Returns: |
| 2267 | A nested structure of `tf.TensorShape` objects matching the structure of |
| 2268 | the dataset / iterator elements and specifying the shape of the individual |
| 2269 | components. |
| 2270 | """ |
| 2271 | return nest.map_structure( |
| 2272 | lambda component_spec: component_spec._to_legacy_output_shapes(), # pylint: disable=protected-access |
| 2273 | get_structure(dataset_or_iterator)) |
| 2274 | |
| 2275 | |
| 2276 | @tf_export(v1=["data.get_output_types"]) |
no test coverage detected