5,337
edits
Line 124: | Line 124: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
}} | }} | ||
==Operators== | |||
===Matrix Multiplication=== | |||
The two matrix multiplication operators are: | |||
* <code>tf.linalg.matmul</code> (also aliased as <code>tf.matmul</code>) | |||
* <code>tf.linalg.matvec</code> | |||
New: With both operators, the first few dimensions can now be the batch size. | |||
E.g. If A is \(b_1 \times b_2 \times 3 \times 3\) and \(B\) is \(b_1 \times b_2 \times 3\), you can multiply them with \(C = \operatorname{tf.linalg.matvec}(A,B)\) and \(C\) will be \(b_1 \times b_2 \times 3\). | |||
Also the batch size in A can be 1 and it will properly broadcast to the same size as \(B\). | |||
==Usage (TF1)== | ==Usage (TF1)== |