From c1843fd2ae84fc3f88b7eb40953dbed38a682083 Mon Sep 17 00:00:00 2001 From: Xin Pan Date: Wed, 13 Jun 2018 17:49:44 +0800 Subject: [PATCH] improve --- python/paddle/fluid/layers/control_flow.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/python/paddle/fluid/layers/control_flow.py b/python/paddle/fluid/layers/control_flow.py index 22791977170..4db085e9f55 100644 --- a/python/paddle/fluid/layers/control_flow.py +++ b/python/paddle/fluid/layers/control_flow.py @@ -1219,20 +1219,21 @@ class IfElse(object): Examples: .. code-block:: python - limit = layers.fill_constant_batch_size_like( + limit = fluid.layers.fill_constant_batch_size_like( input=label, dtype='int64', shape=[1], value=5.0) - cond = layers.less_than(x=label, y=limit) - ie = layers.IfElse(cond) + cond = fluid.layers.less_than(x=label, y=limit) + ie = fluid.layers.IfElse(cond) with ie.true_block(): true_image = ie.input(image) - hidden = layers.fc(input=true_image, size=100, act='tanh') - prob = layers.fc(input=hidden, size=10, act='softmax') + hidden = fluid.layers.fc(input=true_image, size=100, act='tanh') + prob = fluid.layers.fc(input=hidden, size=10, act='softmax') ie.output(prob) with ie.false_block(): false_image = ie.input(image) - hidden = layers.fc(input=false_image, size=200, act='tanh') - prob = layers.fc(input=hidden, size=10, act='softmax') + hidden = fluid.layers.fc( + input=false_image, size=200, act='tanh') + prob = fluid.layers.fc(input=hidden, size=10, act='softmax') ie.output(prob) prob = ie() """ -- GitLab