代码自测学习

1. tensor索引

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

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

 

posted @ 2023-05-02 16:48  helloWorldhelloWorld  阅读(23)  评论(0)    收藏  举报