立即学习:https://edu.youkuaiyun.com/course/play/27286/361358?utm_source=blogtoedu
#生成一串连续的数据
tensor = torch.arange(2,14)
#取第二个位置的数据
tensor[2]
#取第一个到第四个位置的数据
tensor[1:4]
#取前5个值
tensor[:5]
立即学习:https://edu.youkuaiyun.com/course/play/27286/361358?utm_source=blogtoedu
#生成一串连续的数据
tensor = torch.arange(2,14)
#取第二个位置的数据
tensor[2]
#取第一个到第四个位置的数据
tensor[1:4]
#取前5个值
tensor[:5]