Merge pull request #45495 from jackd:jackd/dataset-determinism-docs

PiperOrigin-RevId: 346841847
Change-Id: I576361c3f25487673500e0e8ca9fbf275923d909
This commit is contained in:
TensorFlower Gardener 2020-12-10 12:48:14 -08:00
commit 94bef4cb74

View File

@ -1784,6 +1784,12 @@ name=None))
... num_parallel_calls=tf.data.AUTOTUNE,
... deterministic=False)
The order of elements yielded by this transformation is deterministic if
`deterministic=True`. If `map_func` contains stateful operations and
`num_parallel_calls > 1`, the order in which that state is accessed is
undefined, so the values of output elements may not be deterministic
regardless of the `deterministic` flag value.
Args:
map_func: A function mapping a dataset element to another dataset element.
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
@ -1792,11 +1798,10 @@ name=None))
`tf.data.AUTOTUNE` is used, then the number of parallel
calls is set dynamically based on available CPU.
deterministic: (Optional.) A boolean controlling whether determinism
should be traded for performance by allowing elements to be produced out
should be traded for performance by allowing elements to be yielded out
of order. If `deterministic` is `None`, the
`tf.data.Options.experimental_deterministic` dataset option (`True` by
default) is used to decide whether to produce elements
deterministically.
default) is used to decide whether to run deterministically.
Returns:
Dataset: A `Dataset`.
@ -1925,8 +1930,7 @@ name=None))
should be traded for performance by allowing elements to be produced out
of order. If `deterministic` is `None`, the
`tf.data.Options.experimental_deterministic` dataset option (`True` by
default) is used to decide whether to produce elements
deterministically.
default) is used to decide whether to run deterministically.
Returns:
Dataset: A `Dataset`.