zeros():构造全零矩阵
>>> zeros(3)
array([ 0., 0., 0.])
>>> zeros((3,3))
array([[ 0., 0., 0.],
[ 0., 0., 0.],
[ 0., 0., 0.]])
ones():构造全一矩阵
>>> ones((3,3))
array([[ 1., 1., 1.],
[ 1., 1., 1.],
[ 1., 1., 1.]])
`
eyes():构造单位矩阵
eye(3)
array([[ 1., 0., 0.],
[ 0., 1., 0.],
[ 0., 0., 1.]])
“`
转自:https://blog.csdn.net/xingchengmeng/article/details/64442935