default_startup_program

paddle.static. default_startup_program ( ) [source]

Get default/global startup program.

The paddle.nn function will append the initialization operators into startup program. The startup_program will initialize the parameters by the OPs.

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

Returns

current default startup program.

Return type

Program

Returns type:

Examples

import paddle

paddle.enable_static()
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()))

Used in the guide/tutorials