We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1fb2d00 commit 0e25f92Copy full SHA for 0e25f92
official/core/input_reader.py
@@ -160,12 +160,15 @@ def _read_tfds(tfds_name: Text,
160
cycle_length: Optional[int] = None,
161
block_length: Optional[int] = None) -> tf.data.Dataset:
162
"""Reads a dataset from tfds."""
163
+ repeat_filenames = is_training and not cache
164
read_config = tfds.ReadConfig(
165
interleave_cycle_length=cycle_length,
166
interleave_block_length=block_length,
167
input_context=input_context,
168
shuffle_seed=seed,
- repeat_filenames=is_training and not cache,
169
+ repeat_filenames=repeat_filenames,
170
+ # Only assert cardinality when we have a finite dataset.
171
+ assert_cardinality=not repeat_filenames,
172
skip_prefetch=True)
173
174
decoders = {}
0 commit comments