Get default/global startup program.

The layer function in api_fluid_layers will create parameters, api_paddle_data_reader_reader , NCCL handles as global variables. The startup_program will initialize them by the OPs in startup Program . The api_fluid_layers function will append these initialization operators into startup program.

This method will return the default or the current startup program. Users can use program_guard to switch Program .

Returns: current default startup Program

Returns type: Program


import paddle.fluid as fluid

main_program = fluid.Program()
startup_program = fluid.Program()
with fluid.program_guard(main_program=main_program, startup_program=startup_program):
    x ="x", shape=[-1, 784], dtype='float32')
    y ="y", shape=[-1, 1], dtype='int32')
    z = fluid.layers.fc(name="fc", input=x, size=10, act="relu")

    print("main program is: {}".format(fluid.default_main_program()))
    print("start up program is: {}".format(fluid.default_startup_program()))