[tf.data] Remove unnecessary BackgroundWorker from MultiDeviceIteratorGetNextFromShardOp.
The underlying MultiDeviceIterator::GetNextFromShard() method is non-blocking, so we can call it directly from the inter-op threadpool thread. This can save O(num_devices * num_iterators) threads from each process that uses a MultiDeviceIterator, and would prevent unnecessary serialization in the case that the GetNextFromShard op is shared between multiple callers (e.g. under Eager mode's kernel cache). PiperOrigin-RevId: 236649650
Loading
Please sign in to comment