Gemm - version 9#

This page documents version 9 of operator Gemm. See Gemm for the latest version (since version 13).

  • Domain: ai.onnx

  • Since version: 9

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): Input tensor C. 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(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64).

Differences with previous version (7)#

SchemaDiff: Gemm (domain 'ai.onnx')

  • old version: 7

  • new version: 9

  • breaking: no

Type constraints:

  • changed ‘T’: added types: [‘tensor(int32)’, ‘tensor(int64)’, ‘tensor(uint32)’, ‘tensor(uint64)’]