code optimize

mixed_precision_init
Qiao Longfei 7 years ago
parent ada43e89c3
commit fab8457e6b

@ -68,20 +68,18 @@ FeedFetchList AsyncSSAGraphExecutor::Run(
if (pool_) { if (pool_) {
run_futures.emplace_back(pool_->enqueue(std::move(call))); run_futures.emplace_back(pool_->enqueue(std::move(call)));
for (auto &f : run_futures) {
if (exception_holder_.IsCaught()) {
f.wait();
} else {
fetch_data.emplace_back(std::move(f.get()));
}
}
} else { } else {
fetch_data.emplace_back(std::move(call())); fetch_data.emplace_back(std::move(call()));
} }
} }
if (pool_) {
for (auto &f : run_futures) {
if (exception_holder_.IsCaught()) {
f.wait();
} else {
fetch_data.emplace_back(std::move(f.get()));
}
}
}
if (exception_holder_.IsCaught()) { if (exception_holder_.IsCaught()) {
exception_holder_.ReThrow(); exception_holder_.ReThrow();
} }

Loading…
Cancel
Save