diff --git a/mace/kernels/neon/batch_norm_neon.cc b/mace/kernels/neon/batch_norm_neon.cc index 61cbed1ae3166301b8cddacbe59f0d0e418fc868..244d564bcf9bb1a35d5e768d7175397b9f90ca45 100644 --- a/mace/kernels/neon/batch_norm_neon.cc +++ b/mace/kernels/neon/batch_norm_neon.cc @@ -26,8 +26,8 @@ void BatchNormFunctor::operator()(const float* input, // new_offset = \offset - mean * common_val; // Y = new_scale * X + new_offset; float new_scale, new_offset; - int count = sample_size >> 2; - int remain_count = sample_size - count; + index_t count = sample_size >> 2; + index_t remain_count = sample_size - (count << 2); for (index_t c = 0; c < channel; ++c) { new_scale = scale[c] / std::sqrt(var[c] + this->variance_epsilon_); new_offset = offset[c] - mean[c] * new_scale;