Commit 71a329d1 authored by Wilson Jallet's avatar Wilson Jallet 🎬
Browse files

numpy-allocator: extend row vector fix to const<EigenRef>

parent 1fe931f0
Pipeline #18579 passed with stage
in 11 minutes and 40 seconds
......@@ -135,10 +135,11 @@ struct NumpyAllocator<const Eigen::Ref<const MatType, Options, Stride> > {
if (NumpyType::sharedMemory()) {
const int Scalar_type_code = Register::getTypeCode<Scalar>();
Eigen::DenseIndex inner_stride = MatType::IsRowMajor ? mat.outerStride()
: mat.innerStride(),
outer_stride = MatType::IsRowMajor ? mat.innerStride()
: mat.outerStride();
const bool reverse_strides = MatType::IsRowMajor || (mat.rows() == 1);
Eigen::DenseIndex inner_stride = reverse_strides ? mat.outerStride()
: mat.innerStride(),
outer_stride = reverse_strides ? mat.innerStride()
: mat.outerStride();
const int elsize = call_PyArray_DescrFromType(Scalar_type_code)->elsize;
npy_intp strides[2] = {elsize * inner_stride, elsize * outer_stride};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment