Creates an n x n identity matrix.
nv_eye_like() is a variant where dtype and device default to those of
like.
Arguments
- n
(
integer(1))
Size of the identity matrix.- dtype
(
character(1)|tengen::DataType)
Data type.- device
(
character(1)|PJRTDevice|quickr_device|NULL)
Device for data to live on.- like
(
arrayish)
Existing array whose attributes are used as defaults (only fornv_eye_like()).
Value
arrayish
An n x n identity matrix.
See also
nv_diag() for general diagonal matrices.