Fastor icon indicating copy to clipboard operation
Fastor copied to clipboard

Inner product between 2 matrices

Open edwardnguyen1705 opened this issue 3 years ago • 0 comments
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.

edwardnguyen1705 avatar Jul 02 '22 10:07 edwardnguyen1705