.. _op_ai_onnx_Gemm: Gemm ==== - **Domain**: ``ai.onnx`` - **Since version**: 13 General Matrix multiplication: https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3 A' = transpose(A) if transA else A B' = transpose(B) if transB else B Compute Y = alpha \* A' \* B' + beta \* C, where input tensor A has shape (M, K) or (K, M), input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N), and output tensor Y has shape (M, N). A will be transposed before doing the computation if attribute transA is non-zero, same for B and transB. **Inputs** - **A** (*T*): Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero. - **B** (*T*): Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero. - **C** (*T*): Optional input tensor C. If not specified, the computation is done as if C is a scalar 0. The shape of C should be unidirectional broadcastable to (M, N). **Outputs** - **Y** (*T*): Output tensor of shape (M, N). **Type Constraints** - **T**: Constrain input and output types to float/int tensors. Allowed types: tensor(bfloat16), tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64). Differences with previous version (11) -------------------------------------- **SchemaDiff**: ``Gemm`` (domain ``'ai.onnx'``) * old version: 11 * new version: 13 * breaking: no **Type constraints:** * changed 'T': added types: ['tensor(bfloat16)'] Version History --------------- - :doc:`Version 11 ` - :doc:`Version 9 ` - :doc:`Version 7 ` - :doc:`Version 6 ` - :doc:`Version 1 `