[tf.contrib.data.map_and_batch()] Parallelize the destruction of old invocation results.
For map functions with a large number of return values, resetting each InvocationResult to an initialized state led to running `Tensor::~Tensor()` a large number of times in series. This change moves that destruction to each invocation's callback, which effectively parallelizes it. A future optimization could involve moving the tensor (and its content) into the batch. PiperOrigin-RevId: 176709725
Loading
Please sign in to comment