[tf.data] Fix non-determinism in `tf.contrib.data.parallel_interleave()`.
Previously, there was an issue that could arise towards the end of iteration, when the number of input elements still being processed dropped below the cycle length. In that case, we could accidentally interpret a regular (non-sloppy) order element as being sloppily emitted, because it was not emitted at the first index we tried (e.g. if the first index we tried corresponded to an exhausted input). The previous logic would only advance to the next slot if the element emitted was from the first index tried (on the mistaken assumption that anything else would be sloppy). This change fixes that issue by checking the sloppy bit as well when deciding to advance. PiperOrigin-RevId: 209506746
Loading
Please sign in to comment