如何将特征与 Pybind11 一起使用
How to Use Eigen with Pybind11
问题描述
我有一个简单的功能,这样
void test2(Eigen::Matrix4f& mat){
std::cout << mat << std::endl;
}
在我的 Python 代码中,我这样做
pylc.test2(np.ones((4,4), dtype=np.float32))
但它崩溃了
TypeError: test2(): incompatible function arguments. The following argument types are supported:
1. (arg0: Eigen::Matrix<float, 4, 4, 0, 4, 4>) -> None
Invoked with: array([[1., 1., 1., 1.],
[1., 1., 1., 1.],
[1., 1., 1., 1.],
[1., 1., 1., 1.]], dtype=float32)
我做错了什么
include <pybind11/eigen.h>
我忘了放这个..
相关文章:
- Pybind11:将元组列表从Python传递到C++
- 如何将enable-if与模板参数和参数包一起使用
- 如何将PERF_AMPLE_READ与mmap一起使用
- 如何将两个不同矢量的同一位置的两个元素组合在一起
- Windows/Cygwin - 不能使用 pybind11 - 犯错误
- 如何将C++中的库和头与MinGW一起使用
- 将--whole archive链接器选项与CMake和具有其他库依赖项的库一起使用
- 为什么我不能将 rand() 与数组的大小一起使用?
- 要与"if constexpr"一起使用的编译时消息(在预处理器之后)
- 用pybind11包装C++抽象类时出错
- 不能将复制初始化与隐式转换的多个步骤一起使用
- 使用Pybind11向Python公开Eigen::张量
- 将fold表达式与std::一起用于两个元组
- spdlog标头仅与外部fmt一起使用.spdlog错误:'内部':不是'fmt'
- 如何在C++中使用pybind11加载一个pickle python列表
- 如何将 Eigen::Ref 与 pybind11 一起使用?
- Python 3.8 不能与 Pybind11 一起导入 [Windows]
- 如何将特征与 Pybind11 一起使用
- 如何将 Pybind11 与 CMAKE 一起使用以链接 2 个模块
- Python 和 C++:如何将 pybind11 与包括 GSL 库在内的 Cmakelist 一起使用