Fastor
Fastor copied to clipboard
Inner product between 2 matrices
trafficstars
Dear @romeric , Thanks for sharing your work. Let see the following pieces of code:
Tensor<float,2,3> m1 = {{1,1},{2,2}};
Tensor<float,2,3> m2 = {{3,3},{4,4}};
Tensor<float,2,2> m3 = inner(m1, m2);
I would like it produces: m3 = {{1*3+1*3, 1*4+1*4}, {2*3+2*3, 2*4+2*4}}, but instead it produces: m3 = {{1*1+2*2+3*3 + 4*4+5*5+6*6, 1*1+2*2+3*3 + 4*4+5*5+6*6}, {1*1+2*2+3*3 + 4*4+5*5+6*6, 1*1+2*2+3*3 + 4*4+5*5+6*6}}
How would I change the code to get the desired the output?
Thanks for your time.