0
在本徵,可以使用做很容易張量收縮:如何在特徵中做張量的外積?
Tensor<double, 1> tensor1;
Tensor<double, 2> tensor2;
// fill with data so that
// tensor1 is of dimensions [10] and tensor2 of dimensions [5,10]
std::array<Eigen::IndexPair<int>, 1> product_dims1 = { IndexPair<int>(1, 0) };
auto tensor = tensor2.contract(tensor1, product_dims1);
// now tensor is of dimensions [5]
我尋找,做收縮的相反,這意味着它一方法有兩個張量A和B,說尺寸的5×10和3×2,並且限定尺寸的新張量的C 5×10×3×2,使得
C_ijkl = A_ij * B_kl
我可以很容易地,如果需要寫這樣的方法,但我得到的意義上它會如果我使用更加優化本地特徵方法。如果您使用本地方法,我也希望能夠使用GPU支持,這對eigen來說非常簡單。
感謝。
你試過了''運營商? –
@Kerrek這不起作用,請看這裏:http://stackoverflow.com/questions/41098944/why-does-the-following-fail-with-eigen – kloop