Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dot product with xtensor_fixed won't compile #186

Open
Binary-Song opened this issue Mar 4, 2021 · 0 comments
Open

dot product with xtensor_fixed won't compile #186

Binary-Song opened this issue Mar 4, 2021 · 0 comments

Comments

@Binary-Song
Copy link

Hello. I tried calling linalg::dot on xtensor_fixed objects, but it wouldn't compile (with Visual Studio 2019).

    xt::xtensor_fixed<double, xt::xshape<2, 3>> x;
    xt::xtensor_fixed<double, xt::xshape<3, 2>> y;
    x.fill(1);
    y.fill(2);
    xt::linalg::dot(x, y); 

The static assertion failed inside the dot function:

[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(317,57): error C2338: broadcast shapes do not match. [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(328): message : 查看对正在编译的 类 模板 实例化“xt::detail::broadcast_fixed_shape_cmp_impl<0,xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(340): message : 查看对正在编译的 类 模板 实例化“xt::detail::broadcast_fixed_shape_impl<std::integer_sequence<size_t,0,1>,xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(438): message : 查看对正在编译的 类 模板 实例化“xt::detail::broadcast_fixed_shape<xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(450): message : 查看对正在编译的 类 模板 实例化“xt::detail::promote_fixed<xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(469): message : 查看对正在编译的 类 模板 实例化“xt::detail::select_promote_index<true,true,xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xshape.hpp(487): message : 查看对正在编译的 类 模板 实例化“xt::detail::promote_index<xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xfunction.hpp(136): message : 查看对正在编译的 类 模板 实例化“xt::promote_shape<xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xfunction.hpp(136): message : 查看对正在编译的 别名 模板 实例化“xt::promote_shape_t<xt::fixed_shape<2,3>,xt::fixed_shape<3,2>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build] C:\Program Files\xtensor\include\xtensor\xiterable.hpp(43): message : 查看对正在编译的 类 模板 实例化“xt::xiterable_inner_types<D>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build]           with
[build]           [
[build]               D=xt::xfunction<xt::detail::multiplies,const xt::xfixed_container<double,xt::fixed_shape<2,3>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &,const xt::xfixed_container<double,xt::fixed_shape<3,2>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &>
[build]           ]
[build] C:\Program Files\xtensor\include\xtensor\xfunction.hpp(178): message : 查看对正在编译的 类 模板 实例化“xt::xconst_iterable<xt::xfunction<F,const xt::xfixed_container<double,xt::fixed_shape<2,3>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &,const xt::xfixed_container<double,xt::fixed_shape<3,2>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &>>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build]           with
[build]           [
[build]               F=xt::detail::multiplies
[build]           ]
[build] C:\Program Files\xtensor-blas\include\xtensor-blas/xlinalg.hpp(687): message : 查看对正在编译的 类 模板 实例化“xt::xfunction<F,const xt::xfixed_container<double,xt::fixed_shape<2,3>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &,const xt::xfixed_container<double,xt::fixed_shape<3,2>,xt::layout_type::row_major,true,xt::xtensor_expression_tag> &>”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build]           with
[build]           [
[build]               F=xt::detail::multiplies
[build]           ]
[build] D:\Projects\CppDL\CppDL\NeuralNetwork\test\NeuralNetworkTest.cpp(11): message : 查看对正在编译的函数 模板 实例化“auto xt::linalg::dot<D,xt::xfixed_container<double,xt::fixed_shape<3,2>,xt::layout_type::row_major,true,xt::xtensor_expression_tag>>(const xt::xexpression<D> &,const xt::xexpression<xt::xfixed_container<double,xt::fixed_shape<3,2>,xt::layout_type::row_major,true,xt::xtensor_expression_tag>> &)”的引用 [D:\Projects\CppDL\build\CppDL\NeuralNetwork\UT_NeuralNetworkTest.vcxproj]
[build]           with
[build]           [
[build]               D=xt::xfixed_container<double,xt::fixed_shape<2,3>,xt::layout_type::row_major,true,xt::xtensor_expression_tag>
[build]           ]

I am using xtensor-blas-0.19.0. Is it a bug or am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant