various product
- dot product
- element-wise product
- inner product
- outer product
- Kronecker product(克罗内克积)
torch.enisum
Einstein notation
1 dot product
线代中的矩阵乘法,A.dot(B)
,表示A的行乘以B的列,A的列数需要等于B的行数。
A = ( a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋱ ⋮ a m 1 a m 2 ⋯ a m n ) , B = ( b 11 b 12 ⋯ b 1 p b 21 b 22 ⋯ b 2 p ⋮ ⋮ ⋱ ⋮ b n 1 b n 2 ⋯ b n p ) {\displaystyle \mathbf {A} ={\begin{pmatrix}a_{11}&a_{12}&\cdots &a_{1n}\\a_{21}&a_{22}&\cdots &a_{2n}\\\vdots &\vdots &\ddots &\vdots \\a_{m1}&a_{m2}&\cdots &a_{mn}\\\end{pmatrix}},\quad \mathbf {B} ={\begin{pmatrix}b_{11}&b_{12}&\cdots &b_{1p}\\b_{21}&b_{22}&\cdots &b_{2p}\\\vdots &\vdots &\ddots &\vdots \\b_{n1}&b_{n2}&\cdots &b_{np}\\\end{pmatrix}}} A=⎝⎜⎜⎜⎛a11a21⋮am1a12a22⋮am2⋯⋯⋱⋯a1na2n⋮amn⎠⎟⎟⎟⎞,B=⎝⎜⎜⎜⎛b11b21⋮bn1b12b22⋮bn2⋯⋯⋱⋯b1pb2p⋮bnp⎠⎟⎟⎟