cupy.identity

cupy.identity(n, dtype=<class 'float'>)[source]

Returns a 2-D identity array.

It is equivalent to eye(n, n, dtype).

Parameters:
  • n (int) – Number of rows and columns.
  • dtype – Data type specifier.
Returns:

A 2-D identity array.

Return type:

cupy.ndarray

See also

numpy.identity()