(ds)
| 467 | """Returns a tf.data.Dataset object after shuffling, decoding, and parsing.""" |
| 468 | |
| 469 | def _shuffle_and_decode(ds): |
| 470 | # If cache is enabled, we will call `shuffle()` later after `cache()`. |
| 471 | if self._is_training and not self._cache: |
| 472 | ds = ds.shuffle(self._shuffle_buffer_size, seed=self._seed) |
| 473 | # Decode |
| 474 | ds = _maybe_map_fn(ds, self._decoder_fn) |
| 475 | return ds |
| 476 | |
| 477 | dataset = tf.nest.map_structure(_shuffle_and_decode, dataset) |
| 478 | if tf.nest.is_nested(dataset): |
nothing calls this directly
no test coverage detected