当前位置:网站首页>torch. How to calculate addmm (m, mat1, mat2)
torch. How to calculate addmm (m, mat1, mat2)
2022-06-13 08:50:00 【Human high quality Algorithm Engineer】
One 、 Function interpretation
stay torch/_C/_VariableFunctions.py Of has the definition , The meaning is to realize the formula :
let me put it another way , It just needs to be introduced 5 Parameters ,mat Multiply each element in by beta,mat1 and mat2 Matrix multiplication ( Multiply left by right ) Then multiply by alpha, Finally, I will 2 The results add up . But that may not be the case , Next blogger wrote a code for you , You get the idea ~
>>> M=torch.ones(2,3)
>>> M
tensor([[1., 1., 1.],
[1., 1., 1.]])
>>> mat1 = 2*torch.ones(2,3)
>>> mat1
tensor([[2., 2., 2.],
[2., 2., 2.]])
>>> mat2 = 3*torch.ones(3,3)
>>> mat2
tensor([[3., 3., 3.],
[3., 3., 3.],
[3., 3., 3.]])
>>> torch.addmm(M, mat1, mat2)
tensor([[19., 19., 19.],
[19., 19., 19.]])
namely mat1mat2+M, Calculate the 23 The matrix results are 19.
边栏推荐
- filebeat采集日志到ELK
- Taobao commodity historical price interface / commodity historical price trend interface code docking and sharing
- Tmall product details interface, tmall product coupon interface, tmall API interface, tmall price monitoring interface, tmall price comparison interface, brand rights protection interface, tmall sales
- JS wrapper object
- Uni app subcontracting loading and optimization
- Differences among let, VaR and const when JS declares variables
- 淘宝商品历史价格接口/商品历史价走势接口代码对接分享
- Uni app essay
- Software Architecture Overview knowledge
- centos 安装mysql及设置远程访问
猜你喜欢
JS - array de duplication in the array object case
5. Attribute selector
VI editor
關於RSA加密解密原理
JS array using the reduce() method
0. some doubts about learning SolidWorks for the first time
Knowledge points related to system architecture 3
DIY UAV (anonymous controller p2+f330 rack)
A solution to create a new EXCEL workbook on win10 computer and change the suffix to xlsm (normally it should be xlsx)
Cesium displays a pop-up box at the specified position and moves with the map
随机推荐
filebeat采集日志到ELK
Invalid flex layout setting width
redis
GBase 8a磁盤問題及處理
Vscode plug in
5、 Constant, variable
Buuctf web (V)
Cesium common events, including click events, mouse events, and camera movement events
[pychart pit stepping record] prompt after configuring remote operation, [errno 2] no such file or directory
Mapbox loads nationwide and provincial range, displaying multi-color animation points, migration lines, 3D histogram, etc
Vscode double shortcut keys up, down, left and right
CentOS installing MySQL and setting up remote access
Redis分布式集群搭建
JS to get the date in the next seven days of the current date
Diversified tables through TL table row consolidation
JS gets the first month of the year, the second month to the last month, and the first day to the last day
JS - set countdown for Date object case
Sky background map, navigation page lovefanfan top
2、 Three ways to write JS code
2021-04-16