From 3416c3599680a73b71ca468715e23acaf04832a0 Mon Sep 17 00:00:00 2001 From: Zhang Ting Date: Mon, 23 Nov 2020 14:29:04 +0800 Subject: [PATCH] refine doc of default_startup_program, test=document_fix (#28951) --- python/paddle/fluid/framework.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/python/paddle/fluid/framework.py b/python/paddle/fluid/framework.py index 24df6db8429..a0d03111aae 100644 --- a/python/paddle/fluid/framework.py +++ b/python/paddle/fluid/framework.py @@ -5382,15 +5382,10 @@ def default_startup_program(): import paddle paddle.enable_static() - main_program = paddle.static.Program() - startup_program = paddle.static.Program() - with paddle.static.program_guard(main_program=main_program, startup_program=startup_program): - x = paddle.static.data(name="x", shape=[-1, 784], dtype='float32') - y = paddle.static.data(name="y", shape=[-1, 1], dtype='int32') - z = paddle.static.nn.fc(name="fc", x=x, size=10, activation="relu") - - print("main program is: {}".format(paddle.static.default_main_program())) - print("start up program is: {}".format(paddle.static.default_startup_program())) + x = paddle.static.data(name="x", shape=[-1, 784], dtype='float32') + out = paddle.static.nn.fc(name="fc", x=x, size=10, activation="relu") + print("main program is: {}".format(paddle.static.default_main_program())) + print("start up program is: {}".format(paddle.static.default_startup_program())) """ return _startup_program_ -- GitLab