当前位置:网站首页>pytorch index_ add_ Usage introduction
pytorch index_ add_ Usage introduction
2022-04-21 17:01:00 【me_ yundou】
x.index_add_(0, assi, y)
For and on behalf of y Every vector in , Add to x On different vectors of , Add it to x On which vector of assi.
x It's the addend ,y It's an addend , It turns out to be and . The three parameters of the function are :
The first parameter 0 Represents the dimension of addition ,
The second parameter assi Represents the sum of items ,
The third parameter y Represents the addend .
Here's the picture , With the whole 0 Of x As an example , stay dim=0 On the use of y Add to x On .

The parameters in this function assi The outermost dimension and y The outermost dimension of must be consistent ,x The additive dimension and y The dimensions of the additive dimension must be consistent . such as ,assi yes [ dim1, ],y yes [ dim1, dim2 ],x yes [ XX, dim2].
In the above example ,assi yes [3,],y yes [3,3],x yes [3,3], Meet dimensional requirements .
So the actual meaning of this function is :
according to assi The specified , take y The sequential items of are added to x The specified index Up , In this case assi yes [1, 1, 2], That is to say y The zeroth vector of , The first vector , The second vector , Add to respectively x Of index by 1,1,2 Go up the vector of .
The results are as follows :

版权声明
本文为[me_ yundou]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204211658202737.html
边栏推荐
猜你喜欢

Redis三种模式——主从复制,哨兵模式,集群

Summary of Wu Enda's course of machine learning (II)

CSP Darknet53

Quick MTF, lens image quality test application

Microcomputer principle and interface technology -- electronic organ experiment report

Cookie&Session学习

How to hide important data in Excel table

ls -al各字段意思

.NET宝藏API之:IHostedService,后台任务执行

Domain information query tool adfind
随机推荐
Quick MTF, lens image quality test application
【newcode】牛牛组队竞赛
NFT板块第二春——关于提前布局 Solana 正在崛起的 NFT 生态系统你需要知道的一切
.NET宝藏API之:IHostedService,后台任务执行
Quick MTF,镜头图像质量测试应用程序
Summary of Wu Enda's course of machine learning (II)
mysql创建数据库sql语句
Multilingual communication foundation 04 grpc and protobuf
检测、跟踪、行为识别All-In-One!产业级行人分析系统重磅开源!
解读论文记录 指出经典的RMS证明过程小错误的一个论文的解读
力扣55. 跳跃游戏
R语言使用Hmisc包的label函数为dataframe中的特定变量(数据列)添加变量标签、将dataframe的数据列名称修改为数据说明标签、而通过数值索引访问dataframe数据列
数据库原理——图书馆管理系统
Conception d'un cas d'essai basé sur l'interface de chiffrement pour le forage pratique de marchandises sèches
机器学习吴恩达课程总结(二)
Vivado验证Vitis HLS生成的IP核
Tips for idea cup filling -- Realizing mouse sliding guide bag
idea装杯小技巧——实现鼠标滑动导包
服装行业要渡“疫情劫”,赢家时尚凭什么成为增长样本?
2022 Beijing purchase strategy III (Policy)