From 1a7ed5dcb61b87902c86a25289007e56a36223e7 Mon Sep 17 00:00:00 2001 From: Cheng Date: Tue, 14 May 2024 21:28:55 +0800 Subject: [PATCH] Fill vector with constructor instead of fill_n (#1113) --- python/src/ops.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/src/ops.cpp b/python/src/ops.cpp index 009b1dace..29ca8ed86 100644 --- a/python/src/ops.cpp +++ b/python/src/ops.cpp @@ -2854,7 +2854,7 @@ void init_ops(nb::module_& m) { if (strides) { a_strides = *strides; } else { - std::fill_n(std::back_inserter(a_strides), a_shape.size(), 1); + a_strides = std::vector(a_shape.size(), 1); for (int i = a_shape.size() - 1; i > 0; i--) { a_strides[i - 1] = a_shape[i] * a_strides[i]; }