From 0225957515909ba592694ceb874f329ab614c6cc Mon Sep 17 00:00:00 2001 From: Qiao Longfei Date: Wed, 17 Oct 2018 10:28:35 +0800 Subject: [PATCH] change elementwise_add to elementwise_add_to test=develop --- paddle/fluid/operators/math/selected_rows_functor.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/paddle/fluid/operators/math/selected_rows_functor.cc b/paddle/fluid/operators/math/selected_rows_functor.cc index 1c0e88f075..2679f501da 100644 --- a/paddle/fluid/operators/math/selected_rows_functor.cc +++ b/paddle/fluid/operators/math/selected_rows_functor.cc @@ -233,8 +233,8 @@ template typename std::enable_if< std::is_floating_point::value && std::is_same::value>::type -elementwise_add(const DeviceContext& ctx, BlasT* blas, - size_t data_len, const T* in, T* out) { +elementwise_add_to(const DeviceContext& ctx, BlasT* blas, + size_t data_len, const T* in, T* out) { blas->AXPY(data_len, 1., in, out); } @@ -242,8 +242,8 @@ template typename std::enable_if< !std::is_floating_point::value && std::is_same::value>::type -elementwise_add(const DeviceContext& ctx, BlasT* blas, - size_t data_len, const T* in, T* out) { +elementwise_add_to(const DeviceContext& ctx, BlasT* blas, + size_t data_len, const T* in, T* out) { for (int64_t i = 0; i < data_len; i++) { out[i] += in[i]; } @@ -308,7 +308,7 @@ struct MergeAdd { for (size_t i = 0; i < input_rows.size(); i++) { size_t out_i = rows_to_id[input_rows[i]]; - elementwise_add( + elementwise_add_to( context, &blas, static_cast(input_width), &input_data[i * input_width], &out_data[out_i * input_width]); } -- GitLab