当前位置:网站首页>Centralized record of experimental problems
Centralized record of experimental problems
2022-04-23 20:47:00 【NuerNuer】
1.torch.repeat and tf.tile
Both functions will tensor Repeat the number of times for a certain dimension of :
a_ = torch.repeat(a, [x,y,x]) #a It's three-dimensional tensor, Put it 1,2,3 Dimension difference repeat x, y, z Time
b_ = tf.tile(b, [c,d,e,f]) #b It's three-dimensional tensor, Put it 1,2,3,4 Dimension difference repeat a,b,c,d Time
2.torch.diagonal and tf.diag_part
Extract the main diagonal element of the tensor
#torch
x = torch.randn(4,4)
tensor([[ 8.4527e-01, 1.9236e+00, -6.9886e-01, -4.1077e-01],
[-1.4905e+00, 2.8126e-01, 9.9094e-02, -2.0024e-03],
[-6.0617e-01, 1.0577e+00, -7.8548e-01, 2.0802e+00],
[-7.9660e-01, 1.2871e+00, -3.5069e-01, -1.5513e+00]])
torch.diagonal(x)
# tensor([ 0.8453, 0.2813, -0.7855, -1.5513])
#tensorflow
a = tf.diag_part(b)
# To be continued 🤪
版权声明
本文为[NuerNuer]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210545522903.html
边栏推荐
- 软件测试要怎么学?自学还是培训看完这篇文章你就懂了
- Bash script learning -- for loop traversal
- JS arrow function user and processing method of converting arrow function into ordinary function
- 浅谈数据库设计之三大范式
- MySQL进阶之表的增删改查
- Linux中,MySQL的常用命令
- On the three paradigms of database design
- PHP的Laravel与Composer部署项目时常见问题
- Syntax Error: TypeError: this. getOptions is not a function
- The problem of 1 pixel border on the mobile terminal
猜你喜欢
Prim、Kruskal
Unity animation creates sequence frame code and generates animationclip
【SQL】字符串系列2:将一个字符串根据特定字符分拆成多行
Elastic box model
Go zero framework database avoidance Guide
GO语言开发天天生鲜项目第三天 案例-新闻发布系统二
Leetcode 74. Search two-dimensional matrix
Write table of MySQL Foundation (create table)
wait、waitpid
vulnhub DC:1渗透笔记
随机推荐
Unity animation creates sequence frame code and generates animationclip
Keywords static, extern + global and local variables
mmap、munmap
JS arrow function user and processing method of converting arrow function into ordinary function
Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
Explore ASP Net core read request The correct way of body
BMP JPEG picture to vector image contourtrace
Is qiniu school useful and is the recommended securities account safe
Linux中,MySQL的常用命令
MySQL数据库常识之储存引擎
Go限制深度遍历目录下文件
3-5通过XSS获取cookie以及XSS后台管理系统的使用
Recommended usage scenarios and production tools for common 60 types of charts
启牛学堂有用吗,推荐的证券账户是否安全
又一款数据分析神器:Polars 真的很强大
High paid programmer & interview question series 91 limit 20000 loading is very slow. How to solve it? How to locate slow SQL?
Fastdfs mind map
An error occurs when the addressable assets system project is packaged. Runtimedata is null
2021-09-02 unity project uses rider to build hot change project failure record of ilruntime
Parsing methods of JSON data in C - jar and jobobject: error reading jar from jsonreader Current JsonReader item