Creates an n x n identity matrix.
Arguments
- n
(
integer(1))
Size of the identity matrix.- dtype
(
character(1)|stablehlo::TensorDataType)
Data type.
Value
tensorish
An n x n identity matrix.
See also
nv_diag() for general diagonal matrices.
Examples
jit_eval(nv_eye(3L))
#> AnvilTensor
#> 1 0 0
#> 0 1 0
#> 0 0 1
#> [ CPUf32{3,3} ]