[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
@ -626,9 +626,10 @@ def map_and_batch(map_func,
|
||||
whether the last batch should be dropped in case its size is smaller than
|
||||
desired; the default behavior is not to drop the smaller batch.
|
||||
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
||||
representing the number of elements to process in parallel. If not
|
||||
specified, `batch_size * num_parallel_batches` elements will be
|
||||
processed in parallel.
|
||||
representing the number of elements to process in parallel. If not
|
||||
specified, `batch_size * num_parallel_batches` elements will be processed
|
||||
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:
|
||||
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.
|
||||
num_parallel_calls: (Optional.) A `tf.int32` scalar `tf.Tensor`,
|
||||
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:
|
||||
Dataset: A `Dataset`.
|
||||
@ -1058,7 +1060,9 @@ class DatasetV2(object):
|
||||
num_parallel_calls: (Optional.) If specified, the implementation creates
|
||||
a threadpool, which is used to fetch inputs from cycle elements
|
||||
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:
|
||||
Dataset: A `Dataset`.
|
||||
|
Loading…
x
Reference in New Issue
Block a user