当前位置:网站首页>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.
边栏推荐
- JS format file unit display
- Custom exception class myexception
- VBA format word (page, paragraph, table, picture)
- 京东商品详情接口,京东详情页接口,宝贝详情页接口,商品属性接口,商品信息查询,商品详细信息接口,h5详情,京东APP详情,京东api接口,京东历史价格数据接口代码对接分享
- 4. Relationship selector (parent-child relationship, ancestor offspring relationship, brother relationship)
- Vscode plug in
- Logstash configuration reference article
- Replace jade engine with EJS
- 0.一些自己初學Solidworks的疑惑
- Installing pytorch under Anaconda
猜你喜欢

2020-12-28

Format_ String_ Server

VS安装VAssistX插件导致WPF-XAML文件输入中文出现乱码问题解决方案

Form exercise 2

DIY UAV (anonymous controller p2+f330 rack)

Animation through svg

d3.js&nvd3. JS - how to set the y-axis range - d3 js & nvd3. js — How to set y-axis range

redis

redis. exceptions. ConnectionError: Error 111 connecting to 172.16.8.128:6379. Connection refused.

VI editor
随机推荐
5、 Constant, variable
7、 JS data type
0. some doubts about learning SolidWorks for the first time
Calculation method of paging
1.初步认识express
File upload JS
System analysis - detailed description
Vscode define code block -- define cursor position
Common network problems and troubleshooting methods of gbase
2、 Three ways to write JS code
2021-04-16
JS wrapper object
DIY UAV (anonymous controller p2+f330 rack)
WARNING:tornado.access:404 GET /favicon.ico (172.16.8.1) 1.84ms [附静态文件设置]
情绪处理技巧
GBase 常见网络问题及排查方法
JD commodity detail interface, JD detail page interface, baby detail page interface, commodity attribute interface, commodity information query, commodity detail interface, H5 details, JD app details,
Redis分布式集群搭建
Buuctf web (V)
GBase 8a磁盤問題及處理