[tf.data] Adding a warning to signal to users that the deterministic
argument is only meaningful when specified in combination with num_parallel_calls
.
PiperOrigin-RevId: 357072441 Change-Id: Id44d8643082d57ffd14e80db9c0ce9b0272b9652
This commit is contained in:
parent
e26688b4df
commit
ed58135ee6
@ -1819,6 +1819,9 @@ name=None))
|
||||
Dataset: A `Dataset`.
|
||||
"""
|
||||
if num_parallel_calls is None:
|
||||
if deterministic is not None:
|
||||
warnings.warn("The `deterministic` argument has no effect unless the "
|
||||
"`num_parallel_calls` argument is specified.")
|
||||
return MapDataset(self, map_func, preserve_cardinality=True)
|
||||
else:
|
||||
return ParallelMapDataset(
|
||||
@ -1955,6 +1958,9 @@ name=None))
|
||||
cycle_length = AUTOTUNE
|
||||
|
||||
if num_parallel_calls is None:
|
||||
if deterministic is not None:
|
||||
warnings.warn("The `deterministic` argument has no effect unless the "
|
||||
"`num_parallel_calls` argument is specified.")
|
||||
return InterleaveDataset(self, map_func, cycle_length, block_length)
|
||||
else:
|
||||
return ParallelInterleaveDataset(
|
||||
@ -2686,6 +2692,9 @@ class DatasetV1(DatasetV2):
|
||||
Dataset: A `Dataset`.
|
||||
"""
|
||||
if num_parallel_calls is None:
|
||||
if deterministic is not None:
|
||||
warnings.warn("The `deterministic` argument has no effect unless the "
|
||||
"`num_parallel_calls` argument is specified.")
|
||||
return DatasetV1Adapter(
|
||||
MapDataset(
|
||||
self,
|
||||
|
Loading…
Reference in New Issue
Block a user