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

This commit is contained in:
Antonio Sánchez
2022-11-29 19:39:29 +00:00
committed by Rasmus Munk Larsen
parent 23524ab6fc
commit 2260e11eb0
2 changed files with 20 additions and 1 deletions

View File

@@ -251,7 +251,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: