File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
python/paddle/fluid/layers Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1142,16 +1142,19 @@ class Switch(object):
1142
1142
The Semantics:
1143
1143
1144
1144
1. A `switch` control-flow checks cases one-by-one.
1145
- 1. The condition of each case is a boolean value, which is a scalar.
1146
- 1. It runs the first matched case, or the default case if there is one.
1147
- 1. Once it matches a case, it runs the corresponding branch and only that branch.
1145
+
1146
+ 2. The condition of each case is a boolean value, which is a scalar.
1147
+
1148
+ 3. It runs the first matched case, or the default case if there is one.
1149
+
1150
+ 4. Once it matches a case, it runs the corresponding branch and only that branch.
1148
1151
1149
1152
Examples:
1150
1153
.. code-block:: python
1151
1154
1152
- with control_flow.Switch() as switch:
1155
+ with fluid. control_flow.Switch() as switch:
1153
1156
with switch.case(global_step == zero_var):
1154
- tensor.assign(input=one_var, output=div_res)
1157
+ fluid. tensor.assign(input=one_var, output=div_res)
1155
1158
1156
1159
"""
1157
1160
You can’t perform that action at this time.
0 commit comments