diff --git a/paddle/math/BaseMatrix.cu b/paddle/math/BaseMatrix.cu index 2afb216db51e3ef3cc043f182601852bf0460529..2f32b3fdd1a26c5b1bca43d0bd0ebb0896a012c4 100644 --- a/paddle/math/BaseMatrix.cu +++ b/paddle/math/BaseMatrix.cu @@ -1449,8 +1449,8 @@ template<> template int BaseMatrixT::applyRow(Agg agg, BaseMatrixT& b) { MatrixOffset offset(0, 0, 0, 0, 0, 0); - auto numRows = b.height_; - auto numCols = b.width_; + size_t numRows = b.height_; + size_t numCols = b.width_; CHECK_EQ(height_, numRows); CHECK_EQ(width_, 1UL); aggregate(agg, base::unary::identity(), base::binary::second(), b, numRows, @@ -1463,8 +1463,8 @@ template<> template int BaseMatrixT::applyRow(Agg agg, Saver sv, BaseMatrixT& b) { MatrixOffset offset(0, 0, 0, 0, 0, 0); - auto numRows = b.height_; - auto numCols = b.width_; + size_t numRows = b.height_; + size_t numCols = b.width_; CHECK_EQ(height_, numRows); CHECK_EQ(width_, 1UL); aggregate(agg, base::unary::identity(), sv, b, numRows, numCols, offset, @@ -1493,8 +1493,8 @@ template int BaseMatrixT::applyRow(Agg agg, Op op, Saver sv, BaseMatrixT& b, BaseMatrixT& c) { MatrixOffset offset(0, 0, 0, 0, 0, 0); - auto numRows = b.height_; - auto numCols = b.width_; + size_t numRows = b.height_; + size_t numCols = b.width_; CHECK_EQ(height_, numRows); CHECK_EQ(width_, 1UL); CHECK_EQ(c.height_, numRows); @@ -1524,8 +1524,8 @@ template<> template int BaseMatrixT::applyCol(Agg agg, BaseMatrixT& b) { MatrixOffset offset(0, 0, 0, 0, 0, 0); - auto numRows = b.height_; - auto numCols = b.width_; + size_t numRows = b.height_; + size_t numCols = b.width_; CHECK_EQ(width_, numCols); CHECK_EQ(height_, 1UL); aggregate(agg, base::unary::identity(), base::binary::second(), b, numRows, @@ -1538,8 +1538,8 @@ template<> template int BaseMatrixT::applyCol(Agg agg, Saver sv, BaseMatrixT& b) { MatrixOffset offset(0, 0, 0, 0, 0, 0); - auto numRows = b.height_; - auto numCols = b.width_; + size_t numRows = b.height_; + size_t numCols = b.width_; CHECK_EQ(width_, numCols); CHECK_EQ(height_, 1UL); aggregate(agg, base::unary::identity(), sv, b, numRows, numCols, offset, diff --git a/paddle/math/Vector.cpp b/paddle/math/Vector.cpp index 9ef7f2b4b5ba0044dbd42add3f5aa8f5d42ea52c..68a1518d67e6b7f2d59aa5e50ac11ec9af4030d9 100644 --- a/paddle/math/Vector.cpp +++ b/paddle/math/Vector.cpp @@ -82,8 +82,8 @@ MatrixPtr VectorT::toOneHotSparseMatrix(size_t idRange, bool useGpu) { template <> MatrixPtr VectorT::toOneHotSparseMatrix(size_t idRange, bool useGpu) { - auto height = getSize(); - auto width = idRange; + size_t height = getSize(); + size_t width = idRange; MatrixPtr mat = Matrix::createSparseMatrix( height, idRange, height, NO_VALUE, SPARSE_CSR, false, useGpu);