Description
Description
block_diag
is a core math function that should live in pytensor
and be aliased in pm.math
, rather than being directly defined there. pymc-devs/pytensor#576 moves the block_diag code, along with relevant support code (pm.math.ix
, pm.math.largest_common_dtype
, into pytensor. The PyMC function should be replaced with an alias to that new function once merged.
In addition, the pytensor function is going to more closely follow the scipy API, which means that the function signature will change from pm.math.block_diag(matrices)
to pm.math.block_diag(*matrices)
. Scipy also has separate functions for the sparse and dense cases, which I think we should have as well (rather than a single function). This necessitates a depreciation warning and a temporary helper function to dispatch to either pytensor.tensor.slinalg.block_diag
or pytensor.sparse.block_diag