def ReverseV2 ( a , axes ) : idxs = tuple ( slice ( None , None , 2 * int ( i not in axes ) - 1 ) for i in range ( len ( a . shape ) ) ) return np . copy ( a [ idxs ] ) ,
python slice numpy inverse
Reverse op .
def ReverseV2(a, axes):
    """
    Reverse op.
    """
    idxs = tuple(slice(None, None, 2 * int(i not in axes) - 1) for i in range(len(a.shape)))
    return np.copy(a[idxs]),