From 913afe1890779daebf1d0a200bfa6709e99bea5d Mon Sep 17 00:00:00 2001 From: Zhen Wang Date: Thu, 18 Oct 2018 23:39:13 +0800 Subject: [PATCH] update RowwiseAdd&ClearTensor --- src/operators/math/math_function.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/operators/math/math_function.cpp b/src/operators/math/math_function.cpp index 9d39f89b04..fc4c385add 100644 --- a/src/operators/math/math_function.cpp +++ b/src/operators/math/math_function.cpp @@ -135,7 +135,7 @@ template struct ClearTensor { void operator()(framework::Tensor *tensor) { auto size = tensor->numel(); - auto *tensor_data = tensor->data(); + auto *tensor_data = tensor->data(); memset((void *)tensor_data, 0, sizeof(T) * size); // NOLINT } }; @@ -151,9 +151,9 @@ struct RowwiseAdd { PADDLE_MOBILE_ENFORCE((output->dims() == in_dims), "output->dims() must be equal to in_dims."); - auto *input_data = input.data(); - auto *out_data = output->data(); - auto *vec_data = vector.data(); + auto *input_data = input.data(); + auto *out_data = output->data(); + auto *vec_data = vector.data(); for (int64_t i = 0; i < in_dims[0]; ++i) { for (int64_t j = 0; j < size; ++j) { out_data[i * size + j] = input_data[i * size + j] + vec_data[j]; -- GitLab