<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def read_mtx(filename: PathLike, dtype: str='float32') -> AnnData: """Read ``.mtx`` file. Parameters filename The filename. dtype Numpy data type. """

    from scipy.io import mmread
    # could be rewritten accounting for dtype to be more performant
    X = mmread(fspath(filename)).astype(dtype)
    from scipy.sparse import csr_matrix
    X = csr_matrix(X)
    return AnnData(X, dtype=dtype)