cupyx.scipy.linalg.block_diag#

cupyx.scipy.linalg.block_diag(*arrs)[source]#

Create a block diagonal matrix from provided arrays.

Given the inputs A, B, and C, the output will have these arrays arranged on the diagonal:

[A, 0, 0]
[0, B, 0]
[0, 0, C]
Parameters
  • A (cupy.ndarray) – Input arrays. A 1-D array of length n is treated as a 2-D array with shape (1,n).

  • B (cupy.ndarray) – Input arrays. A 1-D array of length n is treated as a 2-D array with shape (1,n).

  • C (cupy.ndarray) – Input arrays. A 1-D array of length n is treated as a 2-D array with shape (1,n).

  • ... (cupy.ndarray) – Input arrays. A 1-D array of length n is treated as a 2-D array with shape (1,n).

Returns

Array with A, B, C, … on the diagonal. Output has the same dtype as A.

Return type

(cupy.ndarray)