[英]Eigen Tensor compilation error
我正在試驗Eigen::Tensor
,但我無法理解為什么最基本的示例失敗了。 為什么這段代碼
#include <unsupported/Eigen/CXX11/Tensor>
int main()
{
Eigen::Tensor<int, 2> a(4, 4);
Eigen::Tensor<int, 2> b(4, 4);
a.setRandom();
b.setRandom();
a += b;
return 0;
}
導致錯誤:
In file included from eigen.cpp:2:
In file included from /usr/local/include/eigen3/unsupported/Eigen/CXX11/Tensor:142:
/usr/local/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h:39:7: error: class template partial specialization is not
more specialized than the primary template [-Winvalid-partial-specialization]
class TensorStorage<T, FixedDimensions, Options_>
^
/usr/local/include/eigen3/unsupported/Eigen/CXX11/src/Tensor/TensorStorage.h:34:63: note: template is declared here
template<typename T, typename Dimensions, int Options_> class TensorStorage;
請更新到默認分支(建議用於Tensor模塊),或至少更新到3.3分支的開頭。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.