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, andC, 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
nis treated as a 2-D array with shape(1,n).B (cupy.ndarray) – Input arrays. A 1-D array of length
nis treated as a 2-D array with shape(1,n).C (cupy.ndarray) – Input arrays. A 1-D array of length
nis treated as a 2-D array with shape(1,n)... (cupy.ndarray) – Input arrays. A 1-D array of length
nis 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.
- Array with
- Return type
See also