Create a square identity matrix
JAX implementation of numpy.identity()
.
n (DimSize) – integer specifying the size of each array dimension.
dtype (DTypeLike | None) – optional dtype; defaults to floating point.
Identity array of shape (n, n)
.
Examples
A simple 3x3 identity matrix:
>>> jnp.identity(3) Array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]], dtype=float32)
A 2x2 integer identity matrix:
>>> jnp.identity(2, dtype=int) Array([[1, 0], [0, 1]], dtype=int32)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4