当前位置:网站首页>Tensor 省略号(三个点)切片
Tensor 省略号(三个点)切片
2022-07-03 14:43:00 【swust_fang】
查证这三个点就是省略号的意思
type(...)
<class 'ellipsis'>就是在切片的过程中自动判断维度的意思,基本上就是根据总size-逗号个数,所以在切片操作中不会出现两个省略号,举例比如:
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])
边栏推荐
- Common commands for getting started with mongodb database
- Luogu p3065 [usaco12dec]first! G problem solution
- Niuke bm83 string deformation (case conversion, string inversion, string replacement)
- Etcd cluster permission management and account password usage
- NOI OPENJUDGE 1.6(09)
- 创业团队如何落地敏捷测试,提升质量效能?丨声网开发者创业讲堂 Vol.03
- Luogu p5536 [xr-3] core city solution
- Rasterization: a practical implementation (2)
- Programming language: the essence of type system
- Optical cat super account password and broadband account password acquisition
猜你喜欢

Dllexport et dllimport

tonybot 人形机器人 首次开机 0630

The latest M1 dedicated Au update Adobe audit CC 2021 Chinese direct installation version has solved the problems of M1 installation without flash back!

tonybot 人形机器人 定距移动 代码编写玩法

如何查询淘宝天猫的宝贝类目

Accelerating strategy learning using parallel differentiable simulation

C language to realize mine sweeping

How to query the baby category of tmall on Taobao

Detailed explanation of four modes of distributed transaction (Seata)

Tiantu investment sprint Hong Kong stocks: asset management scale of 24.9 billion, invested in xiaohongshu and Naixue
随机推荐
Zzuli:1046 product of odd numbers
2021-10-16 initial programming
NOI OPENJUDGE 1.5(23)
Zzuli:1058 solving inequalities
Zzuli:1052 sum of sequence 4
Detailed explanation of four modes of distributed transaction (Seata)
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
ConstraintLayout 的使用
数学常数表 by q779
Zzuli:1054 monkeys eat peaches
Code writing and playing method of tonybot humanoid robot at fixed distance
String sort
Luogu p5194 [usaco05dec]scales s solution
[qingniaochangping campus of Peking University] in the Internet industry, which positions are more popular as they get older?
Simulation of LS -al command in C language
Optical cat super account password and broadband account password acquisition
提高效率 Or 增加成本,开发人员应如何理解结对编程?
Rasterization: a practical implementation (2)
tonybot 人形机器人 查看端口并对应端口 0701
洛谷P5018 [NOIP2018 普及组] 对称二叉树 题解