def shuffle_together(self, mats):
"""
:param mats: shuffles the given matrices and maintains the same 'shuffled order' in all matrices
"""
rng = random.getstate()
for mat in mats:
random.setstate(rng) # reset random state to the saved state to get the same 'shuffled order' as previous shuffling
random.shuffle(mat)
评论列表
文章目录