当前位置:网站首页>9. High order operation
9. High order operation
2022-07-27 05:59:00 【Pie star's favorite spongebob】
List of articles
torch.where(condition,x,y)
Is selected according to conditions A still B
Three parameters ,(condition,A,B), Generated C It may come from A( Direct copy ) or B, Part of it comes from A Sure C【0】= A【0】,C【1】=A【1】, But if it comes from C【0,0,1】=A【0,0,1】,C【0,0,2】=B【0,0,2】 etc. , Not as regular as before , You can write condition In the table . In from condition In the table ,1 The place comes from A.
condition The higher the value inside , Taken from the A The higher the probability , Give a condition greater than
0.5 Taken from the A.
for i
for y
if c[i][j]=A[i][j]
This is from cpu The control of the , Very non parallel . We only generate such a condition matrix , Our assignment statements can be highly parallelized , The best thing is to use GPU.
torch.gather(input,dim,index)
Operation of table lookup
Why do you need , Price reference table A, Index of things you need to buy B, Generated C Need basis B According to A Generate items , according to B Index in 0 stay A The collection index in is 0 Item name of .
gather Three parameters , The first is the original table we want to check , The second is dimension , The third is the index table we need , Then output the contents of an original table sorted by the index table .
out[i][j][k]=input[i][j][index[i][j][k] #if dim=2
边栏推荐
猜你喜欢

Day 7. Towards Preemptive Detection of Depression and Anxiety in Twitter

9.高阶操作

Digital image processing Chapter 2 fundamentals of digital image

Inno setup package jar + H5 + MySQL + redis into exe

数字图像处理第五章——图像复原与重建

MySQL如何执行查询语句

如果面试官问你 JVM,额外回答“逃逸分析”技术会让你加分

【好文种草】根域名的知识 - 阮一峰的网络日志

新冠时空分析——Global evidence of expressed sentiment alterations during the COVID-19 pandemic

16.过拟合欠拟合
随机推荐
GBASE 8C——SQL参考6 sql语法(11)
Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output
GBASE 8C——SQL参考 5 全文检索
数字图像处理 第一章 绪论
Seektiger will launch STI fusion mining function to obtain Oka pass
GBASE 8C——SQL参考6 sql语法(13)
新冠时空分析——Global evidence of expressed sentiment alterations during the COVID-19 pandemic
GBASE 8C——SQL参考6 sql语法(7)
什么是okr,和kpi的区别在哪里
9.高阶操作
Cap principle
根据文本自动生成UML时序图(draw.io格式)
如果面试官问你 JVM,额外回答“逃逸分析”技术会让你加分
Digital image processing Chapter 5 - image restoration and reconstruction
Getaverse, a distant bridge to Web3
vscode打造golang开发环境以及golang的debug单元测试
andorid检测GPU呈现速度和过度绘制
西瓜书学习笔记---第一、二章
1.PyTorch简介
一张照片攻破人脸识别系统:能点头摇头张嘴,网友