def _get_csr_submatrix_major_axis(Ap, Aj, Ax, start, stop):
    """Return a submatrix of the input sparse matrix by slicing major axis.

    Args:
        Ap (cupy.ndarray): indptr array from input sparse matrix
        Aj (cupy.ndarray): indices array from input sparse matrix
        Ax (cupy.ndarray): data array from input sparse matrix
        start (int): starting index of major axis
        stop (int): ending index of major axis

    Returns:
        Bp (cupy.ndarray): indptr array of output sparse matrix
        Bj (cupy.ndarray): indices array of output sparse matrix
        Bx (cupy.ndarray): data array of output sparse matrix

    """
    Ap = Ap[start:stop + 1]
    start_offset, stop_offset = int(Ap[0]), int(Ap[-1])
    Bp = Ap - start_offset
    Bj = Aj[start_offset:stop_offset]
    Bx = Ax[start_offset:stop_offset]

    return Bp, Bj, Bx