get_program_persistable_vars

paddle.fluid.io.get_program_persistable_vars(program)[source]

Get all the persistable vars from Program.

Parameters

var (Program) – The Program to get persistable vars

Returns

The list contains all persistable vars in the program

Return type

list

Examples

import paddle.fluid as fluid
data = fluid.data(name="img", shape=[64, 784])
w = fluid.layers.create_parameter(shape=[784, 200], dtype='float32', name='fc_w')
b = fluid.layers.create_parameter(shape=[200], dtype='float32', name='fc_b')
list_para  = fluid.io.get_program_persistable_vars(  fluid.default_main_program() )