Did I find the right examples for you? yes no

# bsr.bsr_matrix

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

```    def tobsr(self, blocksize=None, copy=True):
from .bsr import bsr_matrix

if blocksize is None:
from .spfuncs import estimate_blocksize
return self.tobsr(blocksize=estimate_blocksize(self))

elif blocksize == (1,1):
arg1 = (self.data.reshape(-1,1,1),self.indices,self.indptr)
return bsr_matrix(arg1, shape=self.shape, copy=copy)
```
```                    indptr, indices, data.ravel())

return bsr_matrix((data,indices,indptr), shape=self.shape)

# these functions are used by the parent class (_cs_matrix)
```

```    def tobsr(self, blocksize=None, copy=True):
from bsr import bsr_matrix

if blocksize is None:
from spfuncs import estimate_blocksize
return self.tobsr(blocksize=estimate_blocksize(self))

elif blocksize == (1,1):
arg1 = (self.data.reshape(-1,1,1),self.indices,self.indptr)
return bsr_matrix(arg1, shape=self.shape, copy=copy )
```
```                    indptr, indices, data.ravel() )

return bsr_matrix((data,indices,indptr), shape=self.shape)

# these functions are used by the parent class (_cs_matrix)
```

```from .csr import csr_matrix
from .csc import csc_matrix
from .bsr import bsr_matrix
from .coo import coo_matrix
from .lil import lil_matrix
```
```        data = data * B

return bsr_matrix((data,A.indices,A.indptr), shape=output_shape)
else:
# use COO
```

```from csr import csr_matrix
from csc import csc_matrix
from bsr import bsr_matrix
from coo import coo_matrix
from lil import lil_matrix
```
```        data = data * B

return bsr_matrix((data,A.indices,A.indptr), shape=output_shape)
else:
#use COO
```