cupy.diagflat#

cupy.diagflat(v, k=0)[source]#

Creates a diagonal array from the flattened input.

Parameters:
  • v (array-like) – Array or array-like object.

  • k (int) – Index of diagonals. See cupy.diag() for detail.

Returns:

A 2-D diagonal array with the diagonal copied from v.

Return type:

cupy.ndarray

See also

numpy.diagflat()