fix C++ multicard inference bug. (#20955)

test=develop
revert-21172-masked_select_api
Zhaolong Xing 5 years ago committed by 石晓伟
parent 47a82e38e3
commit d1a6e112e6

@ -123,7 +123,7 @@ bool AnalysisPredictor::PrepareScope(
status_is_cloned_ = true;
} else {
if (config_.use_gpu_) {
paddle::framework::InitDevices(false, {config_.device_id_});
paddle::framework::InitDevices(false);
} else {
paddle::framework::InitDevices(false, {});
}
@ -501,8 +501,6 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
std::string flag = "--fraction_of_gpu_memory_to_use=" +
std::to_string(fraction_of_gpu_memory);
flags.push_back(flag);
flags.push_back("--selected_gpus=" +
std::to_string(config.gpu_device_id()));
VLOG(3) << "set flag: " << flag;
framework::InitGflags(flags);
}

Loading…
Cancel
Save