@classmethod
def tile(cls, op):
    """
        Use LU decomposition to compute inverse of matrix.
        Given a square matrix A:
        P, L, U = lu(A)
        b_eye is an identity matrix with the same shape as matrix A, then,
        (P * L * U) * A_inv = b_eye
        L * (U * A_inv) = P.T * b_eye
        use `solve_triangular` twice to compute the inverse of matrix A.
        """
    from .lu import lu
    from ..datasource import eye
    from ..base.transpose import TensorTranspose
    from .tensordot import tensordot
    from .solve_triangular import solve_triangular
    in_tensor = op.input
    is_sparse = in_tensor.is_sparse()
    b_eye = eye(in_tensor.shape[0], chunk_size=in_tensor.nsplits, sparse=
        is_sparse)
    b_eye._inplace_tile()
    p, l, u = lu(in_tensor)
    p._inplace_tile()
    p_transpose = TensorTranspose(dtype=p.dtype, sparse=p.op.sparse, axes=
        list(range(in_tensor.ndim))[::-1]).new_tensor([p], p.shape)
    p_transpose._inplace_tile()
    b = tensordot(p_transpose, b_eye, axes=((p_transpose.ndim - 1,), (b_eye
        .ndim - 2,)))
    b._inplace_tile()
    uy = solve_triangular(l, b, lower=True, sparse=op.sparse)
    uy._inplace_tile()
    a_inv = solve_triangular(u, uy, sparse=op.sparse)
    a_inv._inplace_tile()
    return [a_inv]
