[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`.
|
Dataset: A `Dataset`.
|
||||||
"""
|
"""
|
||||||
if num_parallel_calls is None:
|
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)
|
return MapDataset(self, map_func, preserve_cardinality=True)
|
||||||
else:
|
else:
|
||||||
return ParallelMapDataset(
|
return ParallelMapDataset(
|
||||||
@ -1955,6 +1958,9 @@ name=None))
|
|||||||
cycle_length = AUTOTUNE
|
cycle_length = AUTOTUNE
|
||||||
|
|
||||||
if num_parallel_calls is None:
|
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)
|
return InterleaveDataset(self, map_func, cycle_length, block_length)
|
||||||
else:
|
else:
|
||||||
return ParallelInterleaveDataset(
|
return ParallelInterleaveDataset(
|
||||||
@ -2686,6 +2692,9 @@ class DatasetV1(DatasetV2):
|
|||||||
Dataset: A `Dataset`.
|
Dataset: A `Dataset`.
|
||||||
"""
|
"""
|
||||||
if num_parallel_calls is None:
|
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(
|
return DatasetV1Adapter(
|
||||||
MapDataset(
|
MapDataset(
|
||||||
self,
|
self,
|
||||||
|
Loading…
Reference in New Issue
Block a user