If - 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. If1 → If13 +3 -30
If1 → If13 RENAMED
@@ -1 +1 @@
1
1
  If conditional
2
2
  **Attributes**
3
3
  * **else_branch** (required):
4
4
  Graph to run if condition is false. Has N outputs: values you wish
5
5
  to be live-out to the enclosing scope. The number of outputs must
6
6
  match the number of outputs in the then_branch.
7
7
  * **then_branch** (required):
8
8
  Graph to run if condition is true. Has N outputs: values you wish to
9
9
  be live-out to the enclosing scope. The number of outputs must match
10
10
  the number of outputs in the else_branch.
11
11
  **Inputs**
12
12
  * **cond** (heterogeneous) - **B**:
13
13
  Condition for the if
14
14
  **Outputs**
15
15
  Between 1 and 2147483647 outputs.
16
16
  * **outputs** (variadic) - **V**:
17
17
  Values that are live-out to the enclosing scope. The return values
18
- in the then_branch and else_branch must be of the same data
18
+ in the then_branch and else_branch must be of the same shape and
19
+ same data type.
19
- type. The then_branch and else_branch may produce tensors with
20
- the same element type and different shapes. If corresponding outputs
21
- from the then-branch and the else-branch have static shapes S1 and
22
- S2, then the shape of the corresponding output variable of the if-
23
- node (if present) must be compatible with both S1 and S2 as it
24
- represents the union of both possible shapes.For example, if in a
25
- model file, the first output of then_branch is typed float tensor
26
- with shape [2] and the first output of else_branch is another
27
- float tensor with shape [3], If's first output should have (a) no
28
- shape set, or (b) a shape of rank 1 with neither dim_value nor
29
- dim_param set, or (c) a shape of rank 1 with a unique dim_param.
30
- In contrast, the first output cannot have the shape [2] since [2]
31
- and [3] are not compatible.
32
20
  **Type Constraints**
33
21
  * **V** in (
34
- seq(tensor(bool)),
35
- seq(tensor(complex128)),
36
- seq(tensor(complex64)),
37
- seq(tensor(double)),
38
- seq(tensor(float)),
39
- seq(tensor(float16)),
40
- seq(tensor(int16)),
41
- seq(tensor(int32)),
42
- seq(tensor(int64)),
43
- seq(tensor(int8)),
44
- seq(tensor(string)),
45
- seq(tensor(uint16)),
46
- seq(tensor(uint32)),
47
- seq(tensor(uint64)),
48
- seq(tensor(uint8)),
49
22
  tensor(bool),
50
23
  tensor(complex128),
51
24
  tensor(complex64),
52
25
  tensor(double),
53
26
  tensor(float),
54
27
  tensor(float16),
55
28
  tensor(int16),
56
29
  tensor(int32),
57
30
  tensor(int64),
58
31
  tensor(int8),
59
32
  tensor(string),
60
33
  tensor(uint16),
61
34
  tensor(uint32),
62
35
  tensor(uint64),
63
36
  tensor(uint8)
64
37
  ):
65
- All Tensor and Sequence types
38
+ All Tensor types
66
39
  * **B** in (
67
40
  tensor(bool)
68
41
  ):
69
42
  Only bool