代码自测学习

helloWorld / 2023-05-03 / 原文

1. tensor索引

[:, 0:3 , ]  代表从0行开始,一共3-0行

b = torch.arange(16,dtype=float).reshape(1, 4, 4)
print(b)
print(b[ :, 0:1, ])