Gemm - 6 vs 13¶
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.
- Gemm6 → Gemm13 +20 -19
Gemm6 → Gemm13
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
|
+
* B' = transpose(B) if transB else B
|
6
|
+
|
3
|
-
Compute Y = alpha * A * B + beta * C, where input tensor A has
|
7
|
+
Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M),
|
8
|
+
input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N),
|
9
|
+
and output tensor Y has shape (M, N). A will be transposed before doing the
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
the dimension requirement. A will be transposed before doing the computation
|
8
|
-
if attribute transA is non-zero, same for B and transB.
|
10
|
+
computation if attribute transA is non-zero, same for B and transB.
|
11
|
+
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).
|
12
|
+
This operator has **optional** inputs/outputs. See [ONNX IR](https://github.com/onnx/onnx/blob/main/docs/IR.md) for more details about the representation of optional arguments. An empty string may be used in the place of an actual argument's name to indicate a missing argument. Trailing optional arguments (those not followed by an argument that is present) may also be simply omitted.
|
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
|
+
Between 2 and 3 inputs.
|
24
|
+
|
23
25
|
- **A** (heterogeneous) - **T**:
|
24
|
-
Input tensor A
|
26
|
+
Input tensor A. The shape of A should be (M, K) if transA is 0, or (K, M) if transA is non-zero.
|
25
27
|
- **B** (heterogeneous) - **T**:
|
26
|
-
Input tensor B
|
28
|
+
Input tensor B. The shape of B should be (K, N) if transB is 0, or (N, K) if transB is non-zero.
|
27
|
-
- **C** (heterogeneous) - **T**:
|
29
|
+
- **C** (optional, heterogeneous) - **T**:
|
28
|
-
|
30
|
+
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).
|
29
31
|
### Outputs
|
30
32
|
- **Y** (heterogeneous) - **T**:
|
31
|
-
Output tensor.
|
33
|
+
Output tensor of shape (M, N).
|
32
34
|
### Type Constraints
|
33
|
-
* **T** in ( tensor(double), tensor(float), tensor(float16) ):
|
35
|
+
* **T** in ( tensor(bfloat16), 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.? ++++
|