import torch
# 原数据
x = torch.arange(0, 10)
print(x)
# 生成随机索引
shuffle_index=torch.randperm(10)
print(x[shuffle_index])
import torch
# 原数据
x = torch.arange(0, 10)
print(x)
# 生成随机索引
shuffle_index=torch.randperm(10)
print(x[shuffle_index])