Gemm - 6 vs 7

Files changed (1) hide show
  1. Gemm6 → Gemm7 +19 -15
Gemm6 → Gemm7 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
- 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).
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/master/docs/Broadcasting.md>_.
9
13
  **Attributes**
10
14
  * **alpha**:
11
- Scalar multiplier for the product of input tensors A * B, the
15
+ Scalar multiplier for the product of input tensors A * B.
12
- default value is 1.0.
13
16
  * **beta**:
14
- Scalar multiplier for input tensor C, the default value is 1.0.
17
+ Scalar multiplier for input tensor C.
15
- * **broadcast**:
16
- Whether C should be broadcasted
17
18
  * **transA**:
18
19
  Whether A should be transposed
19
20
  * **transB**:
20
21
  Whether B should be transposed
21
22
  **Inputs**
22
23
  * **A** (heterogeneous) - **T**:
24
+ Input tensor A. The shape of A should be (M, K) if transA is 0, or
23
- Input tensor A
25
+ (K, M) if transA is non-zero.
24
26
  * **B** (heterogeneous) - **T**:
27
+ Input tensor B. The shape of B should be (K, N) if transB is 0, or
25
- Input tensor B
28
+ (N, K) if transB is non-zero.
26
29
  * **C** (heterogeneous) - **T**:
30
+ Input tensor C. The shape of C should be unidirectional
27
- Input tensor C
31
+ broadcastable to (M, N).
28
32
  **Outputs**
29
33
  * **Y** (heterogeneous) - **T**:
30
- Output tensor.
34
+ Output tensor of shape (M, N).
31
35
  **Type Constraints**
32
36
  * **T** in (
33
37
  tensor(double),
34
38
  tensor(float),
35
39
  tensor(float16)
36
40
  ):
37
41
  Constrain input and output types to float tensors.