latest (dev)
Copy
Latest development documentation · Updated 2026-10-15
tensorplay._shape_funcs.block_diag
- tensorplay._shape_funcs.block_diag(*tensors)[source]
Builds a block diagonal matrix from the given blocks.
0-D blocks become 1x1 matrices and 1-D blocks become single rows. The blocks are promoted to one type and must share a device; the zeros around them are made on that device by the operator itself.
Help improve this page
Found an error, an unclear step, or a missing example?
Was this page helpful?

