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