@@ -1219,20 +1219,21 @@ class IfElse(object):
1219
1219
Examples:
1220
1220
.. code-block:: python
1221
1221
1222
- limit = layers.fill_constant_batch_size_like(
1222
+ limit = fluid. layers.fill_constant_batch_size_like(
1223
1223
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)
1226
1226
with ie.true_block():
1227
1227
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')
1230
1230
ie.output(prob)
1231
1231
1232
1232
with ie.false_block():
1233
1233
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')
1236
1237
ie.output(prob)
1237
1238
prob = ie()
1238
1239
"""
0 commit comments