Gemm - 1 vs 9¶
Next section compares an older to a newer version of the same operator after both definition are converted into markdown text. Green means an addition to the newer version, red means a deletion. Anything else is unchanged.
- Gemm1 → Gemm9 +17 -18
Gemm1 → Gemm9
RENAMED
@@ -1 +1 @@
|
|
1
1
|
General Matrix multiplication:
|
2
2
|
https://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms#Level_3
|
3
|
+
|
4
|
+
A' = transpose(A) if transA else A
|
5
|
+
|
6
|
+
B' = transpose(B) if transB else B
|
7
|
+
|
3
|
-
Compute Y = alpha * A * B + beta * C, where input tensor A has
|
8
|
+
Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M),
|
9
|
+
input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N),
|
10
|
+
and output tensor Y has shape (M, N). A will be transposed before doing the
|
4
|
-
|
5
|
-
|
6
|
-
If attribute broadcast is non-zero, input tensor C will be broadcasted to match
|
7
|
-
the dimension requirement. A will be transposed before doing the computation
|
8
|
-
if attribute transA is non-zero, same for B and transB.
|
11
|
+
computation if attribute transA is non-zero, same for B and transB.
|
12
|
+
This operator supports **unidirectional broadcasting** (tensor C should be unidirectional broadcastable to tensor A * B); for more details please check [Broadcasting in ONNX](https://github.com/onnx/onnx/blob/main/docs/Broadcasting.md).
|
9
13
|
### Attributes
|
10
14
|
* **alpha - FLOAT** (default is '1.0'):
|
11
|
-
Scalar multiplier for the product of input tensors A * B
|
15
|
+
Scalar multiplier for the product of input tensors A * B.
|
12
16
|
* **beta - FLOAT** (default is '1.0'):
|
13
|
-
Scalar multiplier for input tensor C
|
17
|
+
Scalar multiplier for input tensor C.
|
14
|
-
|
15
|
-
* **broadcast - INT** (default is '0'):
|
16
|
-
|
17
|
-
Whether C should be broadcasted
|
18
18
|
* **transA - INT** (default is '0'):
|
19
19
|
Whether A should be transposed
|
20
20
|
* **transB - INT** (default is '0'):
|
21
21
|
Whether B should be transposed
|
22
22
|
### Inputs
|
23
23
|
- **A** (heterogeneous) - **T**:
|
24
|
-
Input tensor A
|
24
|
+
Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.
|
25
25
|
- **B** (heterogeneous) - **T**:
|
26
|
-
Input tensor B
|
26
|
+
Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.
|
27
27
|
- **C** (heterogeneous) - **T**:
|
28
|
-
Input tensor C
|
28
|
+
Input tensor C. The shape of C should be unidirectional broadcastable to (M, N).
|
29
29
|
### Outputs
|
30
30
|
- **Y** (heterogeneous) - **T**:
|
31
|
-
Output tensor.
|
31
|
+
Output tensor of shape (M, N).
|
32
32
|
### Type Constraints
|
33
|
-
* **T** in ( tensor(double), tensor(float), tensor(float16) ):
|
33
|
+
* **T** in ( tensor(double), tensor(float), tensor(float16), tensor(int32), tensor(int64), tensor(uint32), tensor(uint64) ):
|
34
|
-
Constrain input and output types to float tensors.+ Constrain input and output types to float/int tensors.? ++++
|