提交 1954de98 编写于 作者: J jiweibo

update. fix compile error. test=develop

上级 1ba4b51a
...@@ -61,9 +61,8 @@ class LITE_API Predictor { ...@@ -61,9 +61,8 @@ class LITE_API Predictor {
const std::vector<std::string>& var_names = {}) const std::vector<std::string>& var_names = {})
: program_desc_(desc), scope_(root) { : program_desc_(desc), scope_(root) {
Program program(*desc.get(), scope_, valid_places, var_names); Program program(*desc.get(), scope_, valid_places, var_names);
std::vector<std::string> passes{};
// TODO(wilber): rethink a new way to associate config and passes. // TODO(wilber): rethink a new way to associate config and passes.
optimizer_ = Optimizer(std::move(program), valid_places, passes); optimizer_ = Optimizer(std::move(program), valid_places);
exec_scope_ = optimizer_.exec_scope(); exec_scope_ = optimizer_.exec_scope();
valid_places_ = valid_places; valid_places_ = valid_places;
} }
......
...@@ -157,13 +157,21 @@ void CxxPaddleApiImpl::OutputSync() { ...@@ -157,13 +157,21 @@ void CxxPaddleApiImpl::OutputSync() {
std::unique_ptr<lite_api::Tensor> CxxPaddleApiImpl::GetInput(int i) { std::unique_ptr<lite_api::Tensor> CxxPaddleApiImpl::GetInput(int i) {
auto *x = raw_predictor_->GetInput(i); auto *x = raw_predictor_->GetInput(i);
#ifdef LITE_WITH_CUDA
return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x, io_stream_)); return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x, io_stream_));
#else
return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x));
#endif
} }
std::unique_ptr<const lite_api::Tensor> CxxPaddleApiImpl::GetOutput( std::unique_ptr<const lite_api::Tensor> CxxPaddleApiImpl::GetOutput(
int i) const { int i) const {
const auto *x = raw_predictor_->GetOutput(i); const auto *x = raw_predictor_->GetOutput(i);
#ifdef LITE_WITH_CUDA
return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x, io_stream_)); return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x, io_stream_));
#else
return std::unique_ptr<lite_api::Tensor>(new lite_api::Tensor(x));
#endif
} }
std::vector<std::string> CxxPaddleApiImpl::GetInputNames() { std::vector<std::string> CxxPaddleApiImpl::GetInputNames() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册