当前位置:网站首页>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.
边栏推荐
- Docker installing MySQL local remote connection docker container MySQL
- ERP outlet
- Object array de encapsulation
- Time and date processing in JS
- JS gets the first month of the year, the second month to the last month, and the first day to the last day
- GBase 常见网络问题及排查方法
- Cesium common events, including click events, mouse events, and camera movement events
- How to save the video of wechat video number locally?
- Common network problems and troubleshooting methods of gbase
- 關於RSA加密解密原理
猜你喜欢

Invalid flex layout setting width

Differences and uses among cookies, localstorage, sessionstorage, and application caching

Replace jade engine with EJS

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

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

JS - print 99 multiplication table of the for cycle case

Cesium displays a pop-up box at the specified position and moves with the map

VI editor

anaconda下安装pytorch

Installing pytorch under Anaconda
随机推荐
JS array method
抖音关键词搜索列表接口,超详细的接口对接步骤
天猫商品详情接口,天猫商品优惠券接口,天猫api接口,天猫价格监控接口,天猫比价接口,品牌维权接口,天猫销量api接口,接口代码可对接数据分析业务,品牌维权,比价业务,行业分析业务接口代码分享
2021-04-16
Cesium achieves sunny, rainy, foggy, snowy and other effects
WARNING:tornado. access:404 GET /favicon. ICO (172.16.8.1) 1.84ms [with static file settings]
5. Attribute selector
Margin:0 reason why auto does not take effect
JS array using the reduce() method
Buuctf web (VII)
Problèmes et traitement du disque gbase 8a
Review one flex knowledge point every day
JS obtain geographic location information according to longitude and latitude and mark it on the map
Sky background map, navigation page lovefanfan top
VBA format word (page, paragraph, table, picture)
JS - array de duplication in the array object case
Uni app essay
6、 JS naming rules and specifications
关于RSA加密解密原理
8、 JS data type conversion