Sub - 1 vs 14#

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. Sub1 → Sub14 +33 -17
Sub1 → Sub14 RENAMED
@@ -1 +1 @@
1
- Performs element-wise binary subtraction (with Numpy-style broadcasting support).
1
+ Performs element-wise binary subtraction (with limited broadcast support).
2
+ If necessary the right-hand-side argument will be broadcasted to match the
2
- This operator supports **multidirectional (i.e., Numpy-style) broadcasting**; for more details please check Broadcasting in ONNX <https://github.com/onnx/onnx/blob/master/docs/Broadcasting.md>_.
3
+ shape of left-hand-side argument. When broadcasting is specified, the second
4
+ tensor can either be of element size 1 (including a scalar tensor and any
5
+ tensor with rank equal to or smaller than the first tensor), or having its
6
+ shape as a contiguous subset of the first tensor's shape. The starting of the
7
+ mutually equal shape is specified by the argument "axis", and if it is not set,
8
+ suffix matching is assumed. 1-dim expansion doesn't work yet.
3
- (Opset 14 change): Extend supported types to include uint8, int8, uint16, and int16.
9
+ For example, the following tensor shapes are supported (with broadcast=1):
10
+
11
+ shape(A) = (2, 3, 4, 5), shape(B) = (,), i.e. B is a scalar tensor
12
+ shape(A) = (2, 3, 4, 5), shape(B) = (1, 1), i.e. B is an 1-element tensor
13
+ shape(A) = (2, 3, 4, 5), shape(B) = (5,)
14
+ shape(A) = (2, 3, 4, 5), shape(B) = (4, 5)
15
+ shape(A) = (2, 3, 4, 5), shape(B) = (3, 4), with axis=1
16
+ shape(A) = (2, 3, 4, 5), shape(B) = (2), with axis=0
17
+
18
+ Attribute broadcast=1 needs to be passed to enable broadcasting.
19
+
20
+ **Attributes**
21
+
22
+ * **axis**:
23
+ If set, defines the broadcast dimensions. See doc for details.
24
+ * **broadcast**:
25
+ Pass 1 to enable broadcasting
26
+ * **consumed_inputs**:
27
+ legacy optimization attribute.
4
28
  **Inputs**
5
29
  * **A** (heterogeneous) - **T**:
6
- First operand.
30
+ First operand, should share the type with the second operand.
7
31
  * **B** (heterogeneous) - **T**:
8
- Second operand.
32
+ Second operand. With broadcasting can be of smaller size than A. If
33
+ broadcasting is disabled it should be of the same size.
9
34
  **Outputs**
10
35
  * **C** (heterogeneous) - **T**:
11
- Result, has same element type as two inputs
36
+ Result, has same dimensions and type as A
12
37
  **Type Constraints**
13
38
  * **T** in (
14
- tensor(bfloat16),
15
39
  tensor(double),
16
40
  tensor(float),
17
- tensor(float16),
41
+ tensor(float16)
18
- tensor(int16),
19
- tensor(int32),
20
- tensor(int64),
21
- tensor(int8),
22
- tensor(uint16),
23
- tensor(uint32),
24
- tensor(uint64),
25
- tensor(uint8)
26
42
  ):
27
- Constrain input and output types to all numeric tensors.? ^^^^^^^^^^
43
+ Constrain input and output types to float tensors.? +++ ^