# Inverse sparse matrix

**URL:** <https://discuss.pytorch.org/t/inverse-sparse-matrix/67579>\
**Category:** Uncategorized\
**Created:** [January 24, 2020, 8:56pm UTC](https://discuss.pytorch.org/t/inverse-sparse-matrix/67579 "2020-01-24T20:56:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kaiseryet](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/kaiseryet/32/19920_2.png) [@kaiseryet](https://discuss.pytorch.org/u/kaiseryet)\
**Post date:** [January 24, 2020, 8:56pm UTC](https://discuss.pytorch.org/t/inverse-sparse-matrix/67579/1 "2020-01-24T20:56:01Z")

</div>

Hey guys, so I have a matrix A which is block-diagonal, now I need to calculate the inverse of A. For block diagonal matrix, we can always inverse each block to obtain the inverse of A; so is there such kind of function in PyTorch to carry out the implementation?

p.s., the blocks are of different sizes, so reshape to a three-dimension tensor is not an option…
