Skip to content

Commit c1843fd

Browse files
committed
improve
1 parent 9185579 commit c1843fd

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/paddle/fluid/layers/control_flow.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,20 +1219,21 @@ class IfElse(object):
12191219
Examples:
12201220
.. code-block:: python
12211221
1222-
limit = layers.fill_constant_batch_size_like(
1222+
limit = fluid.layers.fill_constant_batch_size_like(
12231223
input=label, dtype='int64', shape=[1], value=5.0)
1224-
cond = layers.less_than(x=label, y=limit)
1225-
ie = layers.IfElse(cond)
1224+
cond = fluid.layers.less_than(x=label, y=limit)
1225+
ie = fluid.layers.IfElse(cond)
12261226
with ie.true_block():
12271227
true_image = ie.input(image)
1228-
hidden = layers.fc(input=true_image, size=100, act='tanh')
1229-
prob = layers.fc(input=hidden, size=10, act='softmax')
1228+
hidden = fluid.layers.fc(input=true_image, size=100, act='tanh')
1229+
prob = fluid.layers.fc(input=hidden, size=10, act='softmax')
12301230
ie.output(prob)
12311231
12321232
with ie.false_block():
12331233
false_image = ie.input(image)
1234-
hidden = layers.fc(input=false_image, size=200, act='tanh')
1235-
prob = layers.fc(input=hidden, size=10, act='softmax')
1234+
hidden = fluid.layers.fc(
1235+
input=false_image, size=200, act='tanh')
1236+
prob = fluid.layers.fc(input=hidden, size=10, act='softmax')
12361237
ie.output(prob)
12371238
prob = ie()
12381239
"""

0 commit comments

Comments
 (0)