Skip to content

Remove block_diag from pymc.math in favor of alias to pytensor.tensor.slinalg.block_diag #7085

Closed
@jessegrabowski

Description

@jessegrabowski

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions