当前位置:网站首页>torch stack() meshgrid()
torch stack() meshgrid()
2022-06-30 19:06:00 【Gy Zhao】
x= torch.arange(4)
y= torch.arange(4)
# Input is a one-dimensional sequence , Output two 2D meshes , Commonly used to generate coordinates
ox,oy = torch.meshgrid([x,y])
# Splice according to a certain dimension , Input sequence shape It has to be consistent , The default in accordance with the dim0
o2 = torch.stack((ox,oy))
print(ox,oy)
print(o2,o2.shape)
tensor([[0, 0, 0, 0],
[1, 1, 1, 1],
[2, 2, 2, 2],
[3, 3, 3, 3]])
tensor([[0, 1, 2, 3],
[0, 1, 2, 3],
[0, 1, 2, 3],
[0, 1, 2, 3]])
amount to (0,0)(0,1)… Two pairs of elements with the same position of two-dimensional tensors are one coordinate
tensor([[[0, 0, 0, 0],
[1, 1, 1, 1],
[2, 2, 2, 2],
[3, 3, 3, 3]],
[[0, 1, 2, 3],
[0, 1, 2, 3],
[0, 1, 2, 3],
[0, 1, 2, 3]]]) torch.Size([2, 4, 4])
边栏推荐
- 20220607跌破建议零售价,GPU市场正全面走向供过于求...
- Leader: who can use redis expired monitoring to close orders and get out of here!
- sqlserver SQL Server Management Studio和Transact-SQL创建账户、创建访问指定数据库的只读用户
- Compare the audio librosa library with the Mel spectrogram in the torchaudio library
- Sword finger offer 17 Print from 1 to maximum n digits
- The cloud native landing practice of using rainbow for Tuowei information
- Electronic components bidding and purchasing Mall: optimize traditional purchasing business and speed up enterprise digital upgrading
- CODING 正式入驻腾讯会议应用市场!
- mysql修改数据类型_MySQL修改字段类型[通俗易懂]
- C WinForm program interface optimization example
猜你喜欢

AI首席架构师10-AICA-蓝翔 《飞桨框架设计与核心技术》

领导:谁再用 Redis 过期监听实现关闭订单,立马滚蛋!

MySQL transaction concurrency and mvcc mechanism

Infineon - GTM architecture -generic timer module

屏幕显示技术进化史

System integration project management engineer certification high frequency examination site: prepare project scope management plan

Reading notes of "high EQ means being able to talk"

Swin-Transformer(2021-08)

教你30分钟快速搭建直播间

What if the apple watch fails to power on? Apple watch can not boot solution!
随机推荐
删除排序链表中的重复元素 II[链表节点统一操作--dummyHead]
金融服务行业SaaS项目管理系统解决方案,助力企业挖掘更广阔的增长服务空间
Teach you to quickly set up a live studio in 30 minutes
【TiDB】TiCDC canal_json的实际应用
联想YOGA 27 2022,超强配置全面升级
电子元器件行业在线采购系统精准匹配采购需求,撬动电子产业数字化发展
深度学习编译器的理解
基于UDP协议设计的大文件传输软件
Large file transfer software based on UDP protocol
《客从何处来》
Coding officially entered Tencent conference application market!
Sword finger offer 17 Print from 1 to maximum n digits
Where do the guests come from
Distributed transaction
《所谓情商高,就是会说话》读书笔记
PC wechat multi open
医疗行业企业供应链系统解决方案:实现医疗数智化供应链协同可视
[零基础学IoT Pwn] 环境搭建
Can go struct in go question bank · 15 be compared?
Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills