Add helper for constructing block matrices #1100
Labels
enhancement
New feature or request
feature request
help wanted
Extra attention is needed
linalg
Linear algebra
NumPy compatibility
Description
Numpy has
np.block
, which is gives a nice shorthand for repeated concatenations. For example, say I want to make a block lower-triangle matrix:I can do:
Obviously you can do this in a million different ways, with
np.hstack
,np.vstack
,np.c_
,np.r_r
,np.concat
,np.stack
, etc, etc. But this one is concise and readable.In the content of pytensor, it's related to rewrites in the same vein as #1044. We could very easily break apart these block matrices and do the matmul in chunks, especially if we see there are zero matrices among the blocks.
The text was updated successfully, but these errors were encountered: