From 936926aadd5878c9fc032aaa14da2474100c14f2 Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Mon, 15 Oct 2018 16:59:24 +0800 Subject: [PATCH] code optimize test=develop --- paddle/fluid/operators/math/selected_rows_functor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/operators/math/selected_rows_functor.cc b/paddle/fluid/operators/math/selected_rows_functor.cc index a1be9289984..f6fe2bc2f67 100644 --- a/paddle/fluid/operators/math/selected_rows_functor.cc +++ b/paddle/fluid/operators/math/selected_rows_functor.cc @@ -300,11 +300,11 @@ struct MergeAdd { auto* out_data = out.mutable_value()->data(); + auto blas = math::GetBlas(context); for (auto* input : inputs) { auto* input_data = input->value().data(); auto& input_rows = input->rows(); - auto blas = math::GetBlas(context); for (size_t i = 0; i < input_rows.size(); i++) { size_t out_i = rows_to_id[input_rows[i]]; elementwise_add( -- GitLab