Commit 2941052d authored by Derek Murray's avatar Derek Murray Committed by TensorFlower Gardener
Browse files

[tf.data] Optimize `Dataset.filter()` when the predicate returns one of its args.

This change avoids the overhead of function dispatch (~10--15us) when
the filter predicate simply returns one of its arguments directly. It
also adds a benchmark to track the performance of this optimization.

The checkpointing code required minor modifications to enable functions to be
instantiated in the `FilterDatasetOp::Compute()` method when an iterator is being
restored.

PiperOrigin-RevId: 188229570
parent 10fe6cae
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment