From f1ab13bd0e42005bc3cc1163ef0d8f9c6125c128 Mon Sep 17 00:00:00 2001 From: chengduoZH Date: Tue, 19 Dec 2017 19:16:14 +0800 Subject: [PATCH] refine --- paddle/operators/elementwise_op_function.h | 6 +++--- paddle/operators/math/im2col.cc | 19 +++++++++++-------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/paddle/operators/elementwise_op_function.h b/paddle/operators/elementwise_op_function.h index 65484f318e..9edfacd6df 100644 --- a/paddle/operators/elementwise_op_function.h +++ b/paddle/operators/elementwise_op_function.h @@ -105,8 +105,8 @@ class MidWiseTransformIterator { ++j_; if (UNLIKELY(j_ == post_)) { ++i_; + j_ = 0; if (UNLIKELY(i_ == n_)) { - j_ = 0; i_ = 0; } } @@ -127,10 +127,10 @@ class MidWiseTransformIterator { private: const T* ptr_; - int i_; + int64_t i_; int64_t j_; int64_t n_; - int post_; + int64_t post_; }; #ifdef __NVCC__ diff --git a/paddle/operators/math/im2col.cc b/paddle/operators/math/im2col.cc index a746c267b6..d11a6afe9b 100644 --- a/paddle/operators/math/im2col.cc +++ b/paddle/operators/math/im2col.cc @@ -66,10 +66,10 @@ class Im2ColFunctor= 0 && im_row_offset < im_height && im_col_offset >= 0 && im_col_offset < im_width) { int im_offset = -- GitLab