当前位置:网站首页>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)
边栏推荐
猜你喜欢

ES7 does not use parent-child and nested relationships to implement one to many functions

C#简单介绍

Lightweight and convenient small program to app technology solution to realize interconnection with wechat / traffic app

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

有源差分晶振原理图以及LV-PECL、LVDS、HCSL区别

TypeScript常用类型(一)

MYSQL:Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column

MySQL learning notes

Office application cannot start normally 0xc0000142

Make good use of IDE, speed up R & D efficiency by 100%
随机推荐
Schedule update | 2022 Microsoft and Intel hacker song competition is in hot registration
Typescript advanced type (2)
JS moves the 0 in the array to the end
HTTP缓存<强缓存与协商缓存>
干货 | 一文搞定 pytest 自动化测试框架(二)
Lambda - 1
Introduction to cookie usage
网盘和对象云存储管理之磁盘映射工具比较
Strings in JS (including leetcode examples) < continuous update ~>
Stream flow precautions
Extracting strings with grep awk
VirtualLab basic experiment tutorial -5 Poisson bright spot
Stack in JS (including leetcode examples) < continuous update ~>
Comparison of disk mapping tools for network disk and object cloud storage management
HTTP cache < strong cache and negotiation cache >
leetcode 647. Palindrome substring
Leetcode491 increasing subsequence
Gospel of audio and video developers, rapid integration of AI dubbing capability
GD32F4xx控制DGUS触控按键
vant3+ts h5页面嵌套进app 与原生app通信