I am trying to evaluate the following partial contraction
c(e,q,i,j) = a(e,q,i,j,k,l) * b(e,q,l,k)
using
#include <xtensor/xtensor.hpp>
#include <xtensor/xio.hpp>
#include <xtensor/xrandom.hpp>
#include <xtensor-blas/xlinalg.hpp>
int main()
{
xt::xtensor<double,6> a = xt::random::rand<double>({1,4,2,2,2,2});
xt::xtensor<double,4> b = xt::random::rand<double>({1,4,2,2 });
auto c = xt::linalg::tensordot(a,b,{5,2},{4,3});
}
But this gives me the error that
libc++abi.dylib: terminating with uncaught exception of type xt::transpose_error: Permutation does not have the same size as shape