Fix reshape strides when input has non-zero inner stride.

(cherry picked from commit 2260e11eb0)
This commit is contained in:
Antonio Sánchez
2022-11-29 19:39:29 +00:00
committed by Antonio Sanchez
parent 3eb0c8b69e
commit f5593b4baa
2 changed files with 20 additions and 1 deletions

View File

@@ -250,7 +250,7 @@ class ReshapedImpl_dense<XprType, Rows, Cols, Order, true>
EIGEN_DEVICE_FUNC EIGEN_CONSTEXPR
inline Index outerStride() const
{
return ((Flags&RowMajorBit)==RowMajorBit) ? this->cols() : this->rows();
return (((Flags&RowMajorBit)==RowMajorBit) ? this->cols() : this->rows()) * m_xpr.innerStride();
}
protected: