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

[tf.data] Ensure that all needed functions are available when initializing an iterator.

Previously, the function library would be captured when an `IteratorResource` is first created, which would mean that it is unable to use dataset containing functions defined subsequently, and (e.g.) initialized via a reinitializable iterator. This change moves function library capturing to the `MakeIteratorOp`, which runs in the same graph as the `Dataset` kernels that define the dataset.

This CL also cleans up the locking in `IteratorResource`, and fixes a potential data race when an iterator is being simultaneously used and restored.

Fixes #23334.

PiperOrigin-RevId: 221484449
parent 461ea88d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment