fill_constant

    该OP创建一个形状为shape并且数据类型为dtype的Tensor,同时用 value 中提供的常量初始化该Tensor。

    创建的Tensor的stop_gradient属性默认为True。

    参数:

    • value (float|int)- 用于初始化输出LoDTensor或者SelectedRows的常量数据的值。

    返回: 根据shape和dtype创建的Tensor。

    返回类型:变量(Variable)

    代码示例