If - 1 vs 11#
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.
- If1 → If11 +2 -14
If1 → If11
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
|
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
22
|
tensor(bool),
|
35
23
|
tensor(complex128),
|
36
24
|
tensor(complex64),
|
37
25
|
tensor(double),
|
38
26
|
tensor(float),
|
39
27
|
tensor(float16),
|
40
28
|
tensor(int16),
|
41
29
|
tensor(int32),
|
42
30
|
tensor(int64),
|
43
31
|
tensor(int8),
|
44
32
|
tensor(string),
|
45
33
|
tensor(uint16),
|
46
34
|
tensor(uint32),
|
47
35
|
tensor(uint64),
|
48
36
|
tensor(uint8)
|
49
37
|
):
|
50
38
|
All Tensor types
|
51
39
|
* **B** in (
|
52
40
|
tensor(bool)
|
53
41
|
):
|
54
42
|
Only bool
|