NumpyArrayInitializer

class paddle.fluid.initializer.NumpyArrayInitializer(value)[source]

Init an parameter with an numpy array This op initialize the variable by numpy array.

Parameters

value (numpy) – numpy array to initialize the variable

Returns

A Tensor variable initialized by numpy.

Examples

import paddle.fluid as fluid
import numpy
x = fluid.data(name="x", shape=[2, 1], dtype='float32')
fc = fluid.layers.fc(input=x, size=10,
    param_attr=fluid.initializer.NumpyArrayInitializer(numpy.array([1,2])))