Skip to content
Snippets Groups Projects
Verified Commit 7235c40a authored by Justin Carpentier's avatar Justin Carpentier
Browse files

core: add assert for future debugging

parent 7d28bd5e
No related branches found
No related tags found
No related merge requests found
...@@ -161,7 +161,6 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> { ...@@ -161,7 +161,6 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> {
const int R = (int)PyArray_DIMS(pyArray)[rowMajor]; const int R = (int)PyArray_DIMS(pyArray)[rowMajor];
const long int itemsize = PyArray_ITEMSIZE(pyArray); const long int itemsize = PyArray_ITEMSIZE(pyArray);
const int stride = (int)PyArray_STRIDE(pyArray, rowMajor) / (int)itemsize; const int stride = (int)PyArray_STRIDE(pyArray, rowMajor) / (int)itemsize;
;
if ((MatType::MaxSizeAtCompileTime != R) && if ((MatType::MaxSizeAtCompileTime != R) &&
(MatType::MaxSizeAtCompileTime != Eigen::Dynamic)) { (MatType::MaxSizeAtCompileTime != Eigen::Dynamic)) {
...@@ -171,6 +170,8 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> { ...@@ -171,6 +170,8 @@ struct NumpyMapTraits<MatType, InputScalar, AlignmentValue, Stride, true> {
InputScalar* pyData = reinterpret_cast<InputScalar*>(PyArray_DATA(pyArray)); InputScalar* pyData = reinterpret_cast<InputScalar*>(PyArray_DATA(pyArray));
assert(Stride(stride).inner() == stride &&
"Stride should be a dynamic stride");
return EigenMap(pyData, R, Stride(stride)); return EigenMap(pyData, R, Stride(stride));
} }
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment