From 5adf118ab591a804e4f008039858f3e06d8c6d7f Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Thu, 30 Aug 2018 13:09:29 +0800 Subject: [PATCH] polish --- paddle/fluid/inference/api/api_impl.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/paddle/fluid/inference/api/api_impl.cc b/paddle/fluid/inference/api/api_impl.cc index 0cf7f27b7..7d7a14ed0 100644 --- a/paddle/fluid/inference/api/api_impl.cc +++ b/paddle/fluid/inference/api/api_impl.cc @@ -67,14 +67,12 @@ void NativePaddlePredictor::PrepareFeedFetch() { } feeds_[idx] = op; feed_names_[op->Output("Out")[0]] = idx; - LOG(ERROR) << "feed " << idx << " " << op->Output("Out")[0]; } else if (op->Type() == "fetch") { int idx = boost::get(op->GetAttr("col")); if (fetchs_.size() <= idx) { fetchs_.resize(idx + 1); } fetchs_[idx] = op; - LOG(ERROR) << "fetch " << idx << " " << op->Input("X")[0]; } } } @@ -216,8 +214,7 @@ bool NativePaddlePredictor::SetFeed(const std::vector &inputs, input.set_lod(lod); int idx = -1; if (config_.specify_input_name) { - idx = - boost::get(feeds_[feed_names_[inputs[i].name]]->GetAttr("col")); + idx = feed_names_[inputs[i].name]; } else { idx = boost::get(feeds_[i]->GetAttr("col")); } @@ -231,7 +228,6 @@ bool NativePaddlePredictor::GetFetch(std::vector *outputs, VLOG(3) << "Predictor::get_fetch"; outputs->resize(fetchs_.size()); for (size_t i = 0; i < fetchs_.size(); ++i) { - std::string fetch_target_name = fetchs_[i]->Input("X")[0]; int idx = boost::get(fetchs_[i]->GetAttr("col")); PADDLE_ENFORCE(idx == i); framework::LoDTensor &output = -- GitLab