当前位置:网站首页>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])
边栏推荐
- C language to implement a password manager (under update)
- Joomla! CMS 3.0~3.4.6 RCE
- Zzuli:1046 product of odd numbers
- 表单文本框的使用(一) 选择文本
- Dllexport et dllimport
- Table of mathematical constants by q779
- The mail function of LNMP environment cannot send mail
- Use of constraintlayout
- dllexport和dllimport
- Tailing rushes to the scientific and Technological Innovation Board: it plans to raise 1.3 billion, and Xiaomi Changjiang is the shareholder
猜你喜欢
Why is this error reported when modifying records in the database
ConstraintLayout 的使用
C language to realize mine sweeping
X86 assembly language - Notes from real mode to protected mode
Frequently asked questions: PHP LDAP_ add(): Add: Undefined attribute type in
ShowMeBug入驻腾讯会议,开启专业级技术面试时代
How to color ordinary landscape photos, PS tutorial
retrofit
pyQt界面制作(登录+跳转页面)
Puzzle (016.3) is inextricably linked
随机推荐
tonybot 人形机器人 红外遥控玩法 0630
retrofit
Understand the application scenario and implementation mechanism of differential segment
Zhejiang University Edition "C language programming (4th Edition)" topic set reference ideas set
To improve efficiency or increase costs, how should developers understand pair programming?
C language to realize mine sweeping
Table of mathematical constants by q779
从书本《皮囊》摘录的几个句子
My QT learning path -- how qdatetimeedit is empty
基因家族特征分析 - 染色体定位分析
Zzuli:1045 numerical statistics
J-luggage lock of ICPC Shenyang station in 2021 regional games (simple code)
Talking about part of data storage in C language
洛谷P5536 【XR-3】核心城市 题解
Container of symfony
Solve the problem that PR cannot be installed on win10 system. Pr2021 version -premiere Pro 2021 official Chinese version installation tutorial
Why is this error reported when modifying records in the database
Protobuf and grpc
Add ZABBIX calculation type itemcalculated items
Optical cat super account password and broadband account password acquisition