当前位置:网站首页>torch. New usage of where (old but ignored usage)
torch. New usage of where (old but ignored usage)
2022-06-12 18:14:00 【znsoft】
torch.
where
(condition) → tuple of LongTensor
torch.where(condition)
is identical to torch.nonzero(condition, as_tuple=True)
.
Usually , We all I'll use it like this torch.where function :
torch.where(condition, x, y)
But actually torch.where There is also the usage as shown in the heading , return tuple.
tuple Medium is condition Of qualified values in index.
such as
a=[1,2,3,4,5]
torch.where(a>3)
return ( 3,4)
边栏推荐
- A story on the cloud of the Centennial Olympic Games belonging to Alibaba cloud video cloud
- VirtualLab基础实验教程-4.单缝衍射
- ESP-IDF 添加自己的组件
- Lambda - 1
- Typescript advanced type (2)
- JS moves the 0 in the array to the end
- Office application cannot start normally 0xc0000142
- GD32F4xx控制DGUS触控按键
- USB to serial port - serial port driver type
- Schedule update | 2022 Microsoft and Intel hacker song competition is in hot registration
猜你喜欢
赛程更新| 2022微软与英特尔黑客松大赛火热报名中
PHP implementation of infinite classification tree (recursion and Optimization)
Typescript common types (I)
C#简单介绍
Machine learning series (5): Naive Bayes
GD32F4xx控制DGUS触控按键
Remote gadget putty (Alibaba cloud mirror station address sharing)
vant3 +ts 封装简易step进步器组件
NixOS 22.05安装过程记录
LCD parameter interpretation and calculation
随机推荐
一种好用、易上手的小程序IDE
MYSQL:Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column
This shift, I still have to go
DRM driven MMAP detailed explanation: (I) preliminary knowledge
1.5 what is an architect (serialization)
GD32F4xx控制DGUS触控按键
vant3+ts 封装uploader上传图片组件
When openharmony meets openeuler
Is it safe to open an account in flush
Variable of C #
小程序+App,低成本获客及活跃的一种技术组合思路
Vant3+ts dropdownmenu drop-down menu, multi data can be scrolled
Random talk about redis source code 90
Typescript common types (I)
Random talk about redis source code 91
Common dependencies of SSM
Idea common shortcut keys
Esp-idf adds its own components
High-Speed Layout Guidelines 未完...
Machine learning series (3): logistic regression