diff --git a/aten/src/ATen/native/cpu/moments_utils.h b/aten/src/ATen/native/cpu/moments_utils.h index 6f403d60ea7c..8aba425e8963 100644 --- a/aten/src/ATen/native/cpu/moments_utils.h +++ b/aten/src/ATen/native/cpu/moments_utils.h @@ -8,7 +8,6 @@ #include #include #include -#include #include namespace at::native { @@ -118,9 +117,11 @@ std::pair, opmath_t> RowwiseMomentsImpl(const T* X, int64_t N, in using Vec = vec::Vectorized; const Vec kZeroVec(math_t(0)); - c10::SmallVector m0_stk(depth, 0); - c10::SmallVector m1_stk(depth, kZeroVec); - c10::SmallVector m2_stk(depth, kZeroVec); + std::array m0_stk = {{0}}; + std::array m1_stk; + m1_stk.fill(kZeroVec); + std::array m2_stk; + m2_stk.fill(kZeroVec); for (const auto i : c10::irange(m)) { const T* X_ptr = X + i * kChunkSize * kVecSize;