def list_shuffle(*data): idxs = np_rng.permutation(np.arange(len(data[0]))) if len(data) == 1: return [data[0][idx] for idx in idxs] else: return [[d[idx] for idx in idxs] for d in data]
def shuffle_list(*data): idxs = np_rng.permutation(np.arange(len(data[0]))) if len(data) == 1: return [data[0][idx] for idx in idxs] else: return [[d[idx] for idx in idxs] for d in data]
def tensor_shuffle(data1, data2): print(data1) idxs = np_rng.permutation(np.arange(data1.shape[0])) return data1[idxs], data2[idxs]