[tf.data] Add documentation for supporting tf.data.experimental.AUTOTUNE
as a value for the num_parallel_calls
argument of map()
, interleave()
, and map_and_batch()
.
PiperOrigin-RevId: 224381264
This commit is contained in:
parent
0fb46cf913
commit
2947a28510
@ -627,8 +627,9 @@ def map_and_batch(map_func,
|
|||||||
desired; the default behavior is not to drop the smaller batch.
|
desired; the default behavior is not to drop the smaller batch.
|
||||||
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
||||||
representing the number of elements to process in parallel. If not
|
representing the number of elements to process in parallel. If not
|
||||||
specified, `batch_size * num_parallel_batches` elements will be
|
specified, `batch_size * num_parallel_batches` elements will be processed
|
||||||
processed in parallel.
|
in parallel. If the value `tf.data.experimental.AUTOTUNE` is used, then
|
||||||
|
the number of parallel calls is set dynamically based on available CPU.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
A `Dataset` transformation function, which can be passed to
|
A `Dataset` transformation function, which can be passed to
|
||||||
|
@ -947,7 +947,9 @@ class DatasetV2(object):
|
|||||||
`self.output_types`) to another nested structure of tensors.
|
`self.output_types`) to another nested structure of tensors.
|
||||||
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
||||||
representing the number elements to process in parallel. If not
|
representing the number elements to process in parallel. If not
|
||||||
specified, elements will be processed sequentially.
|
specified, elements will be processed sequentially. If the value
|
||||||
|
`tf.data.experimental.AUTOTUNE` is used, then the number of parallel
|
||||||
|
calls is set dynamically based on available CPU.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dataset: A `Dataset`.
|
Dataset: A `Dataset`.
|
||||||
@ -1058,7 +1060,9 @@ class DatasetV2(object):
|
|||||||
num_parallel_calls: (Optional.) If specified, the implementation creates
|
num_parallel_calls: (Optional.) If specified, the implementation creates
|
||||||
a threadpool, which is used to fetch inputs from cycle elements
|
a threadpool, which is used to fetch inputs from cycle elements
|
||||||
asynchronously and in parallel. The default behavior is to fetch inputs
|
asynchronously and in parallel. The default behavior is to fetch inputs
|
||||||
from cycle elements synchronously with no parallelism.
|
from cycle elements synchronously with no parallelism. If the value
|
||||||
|
`tf.data.experimental.AUTOTUNE` is used, then the number of parallel
|
||||||
|
calls is set dynamically based on available CPU.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
Dataset: A `Dataset`.
|
Dataset: A `Dataset`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user