cupyx.scipy.linalg.block_diag

cupyx.scipy.linalg.block_diag(*arrs)

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

B, C, .. (A,) – 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)