当前位置:网站首页>Tensor ellipsis (three points) slice
Tensor ellipsis (three points) slice
2022-07-03 14:53:00 【swust_ fang】
Checking these three points means ellipsis
type(...)
<class 'ellipsis'>
It means automatically judging the dimension in the process of slicing , Basically, according to the total size- Number of commas , Therefore, two ellipsis will not appear in the slicing operation , For example :
a = torch.randn(3,4,5,6,7,requires_grad=True)
a.shape
>>>torch.Size([3, 4, 5, 6, 7])
a[...,0].shape
>>>torch.Size([3, 4, 5, 6])
a[0,...,0].shape
>>>torch.Size([4, 5, 6])
a[0,1,...,0,0].shape
torch.Size([5])
>>>a[0,...].shape
torch.Size([4, 5, 6, 7])
边栏推荐
- Zzuli:1045 numerical statistics
- Plane vector addition
- To improve efficiency or increase costs, how should developers understand pair programming?
- Tonybot humanoid robot checks the port and corresponds to port 0701
- Luogu p5194 [usaco05dec]scales s solution
- [ue4] Niagara's indirect draw
- 7-9 one way in, two ways out (25 points)
- B2020 分糖果
- 7-3 count the number of words in a line of text
- [opengl] advanced chapter of texture - principle of flowmap
猜你喜欢
Devaxpress: range selection control rangecontrol uses
How to query the baby category of tmall on Taobao
[graphics] efficient target deformation animation based on OpenGL es 3.0
链表有环,快慢指针走3步可以吗
4-24--4-28
Talking about part of data storage in C language
Detailed explanation of four modes of distributed transaction (Seata)
My QT learning path -- how qdatetimeedit is empty
[ue4] geometry drawing pipeline
分布式事务(Seata) 四大模式详解
随机推荐
How can entrepreneurial teams implement agile testing to improve quality and efficiency? Voice network developer entrepreneurship lecture Vol.03
pyQt界面制作(登录+跳转页面)
Timecho of Tianmou technology completed an angel round financing of nearly 100 million yuan to create a native timing database of the industrial Internet of things
406. 根据身高重建队列
[engine development] in depth GPU and rendering optimization (basic)
[graphics] hair simulation in tressfx
Zzuli:1054 monkeys eat peaches
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
How does vs+qt set the software version copyright, obtain the software version and display the version number?
7-9 one way in, two ways out (25 points)
B2020 分糖果
Zzuli:1048 factorial table
Zzuli:1046 product of odd numbers
tonybot 人形机器人 红外遥控玩法 0630
7-3 rental (20 points)
复合类型(自定义类型)
Creation of data table of Doris' learning notes
Zzuli:1059 highest score
[opengl] face pinching system
Qt development - scrolling digital selector commonly used in embedded system