A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.identity.html below:

jax.numpy.identity — JAX documentation

jax.numpy.identity#
jax.numpy.identity(n, dtype=None)[source]#

Create a square identity matrix

JAX implementation of numpy.identity().

Parameters:
  • n (DimSize) – integer specifying the size of each array dimension.

  • dtype (DTypeLike | None) – optional dtype; defaults to floating point.

Returns:

Identity array of shape (n, n).

Return type:

Array

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