eye()
[python] view plain copy
>>> e1 = eye(2, 3, 0, dtype = int)
>>> e1
array([[1, 0, 0]...,
[0, 1, 0]])
>>> e2 = eye(3)
>>> e2
array([[ 1., 0., 0.],
[ 0., 1., ...[0, 1, 0],
[0, 0, 1]])
>>> e4 = eye(3, 1, dtype = int)
>>> e4
array([[1],
...[0],
[0]])
>>> e5 = eye(3, k = 1, dtype = int)
>>> e5
array([[0, 1, 0],
...[0, 0, 1],
[0, 0, 0]])
>>> e6 = eye(3, k = -1, dtype = int)
>>> e6
array([[0, 0, 0