Type IDataset
Namespace tensorflow.data
Interfaces IDataset
Methods
- batch
- cache
- filter
- filter_with_legacy_function
- flat_map
- interleave
- make_initializable_iterator
- map
- map_with_legacy_function
- padded_batch
- shard
- shuffle
- take
- window
- with_options
Properties
Public instance methods
object batch(object batch_size, object drop_remainder)
object cache(object filename)
object filter(object predicate)
object filter_with_legacy_function(object predicate)
Filters this dataset according to `predicate`. (deprecated) Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version.
Instructions for updating:
Use `tf.data.Dataset.filter() NOTE: This is an escape hatch for existing uses of `filter` that do not work
with V2 functions. New uses are strongly discouraged and existing uses
should migrate to `filter` as this method will be removed in V2.
Parameters
-
object
predicate - A function mapping a nested structure of tensors (having shapes
and types defined by `self.output_shapes` and `self.output_types`) to a
scalar
tf.bool
tensor.
Returns
-
object
object flat_map(object map_func)
object interleave(object map_func, object cycle_length, object block_length, object num_parallel_calls)
object make_initializable_iterator(object shared_name)
object map(object map_func, object num_parallel_calls)
object map_with_legacy_function(object map_func, object num_parallel_calls)
Maps `map_func` across the elements of this dataset. (deprecated) Warning: THIS FUNCTION IS DEPRECATED. It will be removed in a future version.
Instructions for updating:
Use `tf.data.Dataset.map() NOTE: This is an escape hatch for existing uses of `map` that do not work
with V2 functions. New uses are strongly discouraged and existing uses
should migrate to `map` as this method will be removed in V2.
Parameters
-
object
map_func - A function mapping a nested structure of tensors (having shapes and types defined by `self.output_shapes` and `self.output_types`) to another nested structure of tensors.
-
object
num_parallel_calls - (Optional.) A
tf.int32
scalartf.Tensor
, representing the number elements to process asynchronously in parallel. If not specified, elements will be processed sequentially. If the valuetf.data.experimental.AUTOTUNE
is used, then the number of parallel calls is set dynamically based on available CPU.
Returns
-
object