![]() |
A transformation that stops dataset iteration based on a predicate
.
Aliases:
tf.data.experimental.take_while(predicate)
Args:
predicate
: A function that maps a nested structure of tensors (having shapes and types defined byself.output_shapes
andself.output_types
) to a scalartf.bool
tensor.
Returns:
A Dataset
transformation function, which can be passed to
tf.data.Dataset.apply
.