Skip to content

Commit 62bf672

Browse files
committed
update document for Switch
1 parent 21ecd35 commit 62bf672

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

python/paddle/fluid/layers/control_flow.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,16 +1142,19 @@ class Switch(object):
11421142
The Semantics:
11431143
11441144
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.
11481151
11491152
Examples:
11501153
.. code-block:: python
11511154
1152-
with control_flow.Switch() as switch:
1155+
with fluid.control_flow.Switch() as switch:
11531156
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)
11551158
11561159
"""
11571160

0 commit comments

Comments
 (0)