def METHOD_NAME(np_data, out_size, pool_op, np_op):
    """The reference function for adaptive pool, channel first layout"""
    ishape = np_data.shape
    n, c = ishape[:2]
    oshape = (n, c) + out_size
    np_out = np.zeros(oshape).astype(np_data.dtype)
    for i in range(n):
        for j in range(c):
            np_out[i, j] = pool_op(ishape[2:], out_size, np_data[i, j], np_op)
    return np_out