Fixed fallback code that optionally created EigenThreadPoolWrapper.

PiperOrigin-RevId: 242897338
This commit is contained in:
Sung Jin Hwang 2019-04-10 10:42:34 -07:00 committed by TensorFlower Gardener
parent 8b5c79a7c7
commit a2d60d14ac

View File

@ -100,10 +100,14 @@ struct LocalDevice::EigenThreadPoolInfo {
Eigen::ThreadPoolInterface* threadpool =
eigen_worker_threads_.workers->AsEigenThreadPool();
if (threadpool == nullptr) {
// This fallback code path is not executed since ThreadPool's current
// implementation of AsEigenThreadPool() always returns a non-null
// pointer.
eigen_threadpool_wrapper_ = absl::make_unique<EigenThreadPoolWrapper>(
eigen_worker_threads_.workers);
threadpool = eigen_threadpool_wrapper_.get();
}
if (allocator) {
if (allocator != nullptr) {
eigen_allocator_.reset(new EigenAllocator(allocator));
}
eigen_device_.reset(new Eigen::ThreadPoolDevice(