这行出错了: m.bias=paddle.full(m.bias.shape, fill_value=0, dtype='float32')
包报错:assignment to parameter 'bias' should be of type Parameter or None, but got 'Tensor'
这是bias: Parameter containing:
Tensor(shape=[60], dtype=float32, place=Place(cpu), stop_gradient=False,
[0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0.])
自己测试结果:
bias=x=paddle.ones([5],dtype='float32')
bias=paddle.full(bias.shape, fill_value=0.2, dtype='float32')
Tensor(shape=[5], dtype=float32, place=Place(cpu), stop_gradient=True,
[1., 1., 1., 1., 1.])
Tensor(shape=[5], dtype=float32, place=Place(cpu), stop_gradient=True,
[0.20000000, 0.20000000, 0.20000000, 0.20000000, 0.20000000])
看过去也没问题,那问题在哪呢