当前位置:网站首页>torch.where的新用法(很老但是大家忽略的用法)
torch.where的新用法(很老但是大家忽略的用法)
2022-06-12 18:04:00 【znsoft】
torch.where(condition) → tuple of LongTensor
torch.where(condition) is identical to torch.nonzero(condition, as_tuple=True).
通常 ,我们都 会这样使用torch.where函数:
torch.where(condition, x, y)
但是实际上torch.where还有如题头如示的用法,返回tuple.
tuple中是condition中符合条件的值的index.
比如
a=[1,2,3,4,5]
torch.where(a>3)
返回( 3,4)
边栏推荐
猜你喜欢

Still using Microsoft office, 3 fairy software, are you sure you don't want to try?

Tutoriel de démarrage rapide JDBC

Esp-idf adds its own components

Overall flow chart of kernel interrupt

用好IDE,研发效能提速100%

TypeScript类型声明文件(三)

Vant3 +ts packaged simple step advancer component

网盘和对象云存储管理之磁盘映射工具比较

Continued 2 asp Net core router basic use demonstration 0.2 acquisition of default controller data

Explanation of core interrupt of Godson processor
随机推荐
Stream流注意点
C business serial number rule generation component
Eve-ng installation (network device simulator)
小程序和App同时拥有?两者兼得的一种技术方案
JDBC快速入門教程
vant3+ts DropdownMenu 下拉菜单,数据多能滚动加载
赛程更新| 2022微软与英特尔黑客松大赛火热报名中
低代码平台调研结果
Write a select based concurrent server
es7不使用父子和嵌套关系来实现一对多功能
Resttemplateconfig configuration print request response log under soringboot
Array sorts in the specified order
vant3+ts 封装uploader上传图片组件
566. reshaping the matrix
机器学习系列(3):Logistic回归
First principles of enterprise architecture
MySQL学习笔记
Use the official go Library of mongodb to operate the original mongodb
vant3+ts h5页面嵌套进app 与原生app通信
ftrace