import torch
# 原数据
x = torch.arange(0, 10)
print(x)
# 生成随机索引
shuffle_index=torch.randperm(10)
print(x[shuffle_index])
pytorch的shuffle功能
最新推荐文章于 2023-07-10 13:03:40 发布
import torch
# 原数据
x = torch.arange(0, 10)
print(x)
# 生成随机索引
shuffle_index=torch.randperm(10)
print(x[shuffle_index])