Destroy batch_thread_pool_ first. For the new in flight batches implementation, the...
authorA. Unique TensorFlower <gardener@tensorflow.org>
Wed, 20 Dec 2017 21:31:06 +0000 (13:31 -0800)
committerTensorFlower Gardener <gardener@tensorflow.org>
Wed, 20 Dec 2017 21:43:29 +0000 (13:43 -0800)
commit3d01a46171b5d256617627537187ab819c196aa4
treeafea1473bb19a15a2c4adc3988f74c6f37a0a01b
parent47249f349d13f5a11a8dc8c4026c54b49c88cfe0
Destroy batch_thread_pool_ first. For the new in flight batches implementation, the callbacks scheduled on this thread pool refer to other class members which must remain alive until the thread pool is empty.

Also fix a similar lifetime issue in the unit tests.

PiperOrigin-RevId: 179726389
tensorflow/contrib/batching/adaptive_shared_batch_scheduler.h
tensorflow/contrib/batching/adaptive_shared_batch_scheduler_test.cc