Gemm - 1 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.

Files changed (1) hide show
  1. Gemm1 → Gemm13 +18 -31
Gemm1 → 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
-
6
- B' = transpose(B) if transB else B
7
-
8
- Compute Y = alpha * A' * B' + beta * C, where input tensor A has shape (M, K) or (K, M),
3
+ Compute Y = alpha * A * B + beta * C, where input tensor A has
4
+ dimension (M X K), input tensor B has dimension (K X N), input tensor C and
5
+ output tensor Y have dimension (M X N).
9
- input tensor B has shape (K, N) or (N, K), input tensor C is broadcastable to shape (M, N),
6
+ If attribute broadcast is non-zero, input tensor C will be broadcasted to match
10
- and output tensor Y has shape (M, N). A will be transposed before doing the
7
+ the dimension requirement. A will be transposed before doing the computation
11
- computation if attribute transA is non-zero, same for B and transB.
8
+ 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/master/docs/Broadcasting.md>_.
13
- This operator has **optional** inputs/outputs. See ONNX <https://github.com/onnx/onnx/blob/master/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.
14
9
  **Attributes**
15
10
  * **alpha**:
16
- Scalar multiplier for the product of input tensors A * B.
11
+ Scalar multiplier for the product of input tensors A * B, the
12
+ default value is 1.0.
17
13
  * **beta**:
18
- Scalar multiplier for input tensor C.
14
+ Scalar multiplier for input tensor C, the default value is 1.0.
15
+ * **broadcast**:
16
+ Whether C should be broadcasted
19
17
  * **transA**:
20
18
  Whether A should be transposed
21
19
  * **transB**:
22
20
  Whether B should be transposed
23
21
  **Inputs**
24
- Between 2 and 3 inputs.
25
-
26
22
  * **A** (heterogeneous) - **T**:
23
+ Input tensor A
27
- Input tensor A. The shape of A should be (M, K) if transA is 0, or
28
- (K, M) if transA is non-zero.
29
24
  * **B** (heterogeneous) - **T**:
25
+ Input tensor B
30
- Input tensor B. The shape of B should be (K, N) if transB is 0, or
31
- (N, K) if transB is non-zero.
32
- * **C** (optional, heterogeneous) - **T**:
26
+ * **C** (heterogeneous) - **T**:
27
+ Input tensor C, can be inplace.
33
- Optional input tensor C. If not specified, the computation is done
34
- as if C is a scalar 0. The shape of C should be unidirectional
35
- broadcastable to (M, N).
36
28
  **Outputs**
37
29
  * **Y** (heterogeneous) - **T**:
38
- Output tensor of shape (M, N).
30
+ Output tensor.
39
31
  **Type Constraints**
40
32
  * **T** in (
41
- tensor(bfloat16),
42
33
  tensor(double),
43
34
  tensor(float),
44
- tensor(float16),
35
+ tensor(float16)
45
- tensor(int32),
46
- tensor(int64),
47
- tensor(uint32),
48
- tensor(uint64)
49
36
  ):
50
- Constrain input and output types to float/int tensors.? ----
37
+ Constrain input and output types to float tensors.