File size: 148 Bytes
d6d3a5b
 
 
 
 
 
 
1
2
3
4
5
6
7
8
import numpy as np


def permute_np(x, idx):
    original_perm = tuple(range(len(x.shape)))
    x = np.moveaxis(x, original_perm, idx)
    return x