TensorFlow: Difference between revisions

Line 131: Line 131:
* [https://www.tensorflow.org/api_docs/python/tf/linalg/matvec <code>tf.linalg.matvec</code>]
* [https://www.tensorflow.org/api_docs/python/tf/linalg/matvec <code>tf.linalg.matvec</code>]


New: With both operators, the first few dimensions can now be the batch size.   
New: With both operators, the first \(k-2\) 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\).   
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\).
Also the batch size in A can be 1 and it will properly broadcast to the same size as \(B\).