From bc9315fe380138ac9b547dd01ac1394ccaf197ce Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Wed, 13 Jul 2022 19:27:00 -0400 Subject: [PATCH] chore: optimize sparse matrix casting with python tuple (#4064) * optimize casting of sparse Eigen arrays * move array * Revert for safety --- include/pybind11/eigen.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/eigen.h b/include/pybind11/eigen.h index 71df3eb8b..4d221b3d7 100644 --- a/include/pybind11/eigen.h +++ b/include/pybind11/eigen.h @@ -692,9 +692,9 @@ struct type_caster::value>> { array outerIndices((rowMajor ? src.rows() : src.cols()) + 1, src.outerIndexPtr()); array innerIndices(src.nonZeros(), src.innerIndexPtr()); - return matrix_type(std::make_tuple( + return matrix_type(pybind11::make_tuple( std::move(data), std::move(innerIndices), std::move(outerIndices)), - std::make_pair(src.rows(), src.cols())) + pybind11::make_tuple(src.rows(), src.cols())) .release(); }