def METHOD_NAME(ind_mat: np.ndarray, dims: np.ndarray) -> np.ndarray:
    """
    This function takes a matrix of indices, and a vector of dimensions, and
    returns a vector of corresponding flattened indices
    """
    # Initialize indices
    r_ind = np.zeros(ind_mat.shape[1:], dtype=np.int64)
    # Find index multipliers
    cdims = np.concatenate((np.cumprod(dims[1:][::-1])[::-1], np.array([1])))
    for i, cdim in enumerate(cdims):
        r_ind += ind_mat[i] * cdim
    return r_ind