From cb54c9aaec35c0d4fa798585e301fc9627278dab Mon Sep 17 00:00:00 2001
From: Justin Carpentier <justin.carpentier@inria.fr>
Date: Tue, 21 Feb 2023 15:19:28 +0100
Subject: [PATCH] core: try a fix for old version of Eigen

---
 include/eigenpy/numpy-allocator.hpp | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/include/eigenpy/numpy-allocator.hpp b/include/eigenpy/numpy-allocator.hpp
index 3382eb32..026f65bc 100644
--- a/include/eigenpy/numpy-allocator.hpp
+++ b/include/eigenpy/numpy-allocator.hpp
@@ -250,7 +250,10 @@ struct numpy_allocator_impl_tensor<Eigen::TensorRef<TensorType> > {
 
       return pyArray;
     } else {
-      return NumpyAllocator<TensorType>::allocate(tensor, nd, shape);
+      return NumpyAllocator<TensorType>::allocate(
+          static_cast<Eigen::TensorBase<Eigen::TensorRef<TensorType> > &>(
+              tensor),
+          nd, shape);
     }
   }
 };
@@ -278,7 +281,11 @@ struct numpy_allocator_impl_tensor<const Eigen::TensorRef<const TensorType> > {
 
       return pyArray;
     } else {
-      return NumpyAllocator<TensorType>::allocate(tensor, nd, shape);
+      return NumpyAllocator<TensorType>::allocate(
+          static_cast<
+              const Eigen::TensorBase<Eigen::TensorRef<const TensorType> > &>(
+              tensor),
+          nd, shape);
     }
   }
 };
-- 
GitLab