python - 替代 `out` 以获得性能?
问题描述
RuntimeError: conj(): functions with out=... arguments don't support
automatic differentiation, but one of the arguments requires grad.
出现在
torch.conj(x[a:b], out=x[a:b])
问题是,x
它很大,并且它的大片被共轭在一个循环中;out=
备用分配中间张量(这要慢得多)。
是否有更快、可区分的替代方案x[a:b] = torch.conj(x[a:b])
?
解决方案
推荐阅读
- typescript - 如何从 Typescript 中的接口中提取“字符串”属性名称?
- javascript - 动态创建对象字面量
- vue.js - Nuxt如何覆盖页面的全局css
- swift - 如何将 CMSampleBuffer 转换为原始帧(比如 UYVY)?
- c# - 为什么在不等待的方法上使用 async 修饰符时编译器不会出错?
- python-3.x - Frappe Framework ERPNEXT:如何在 localhost 上启用 CORS
- flutter - 在 Ubuntu 上构建 Flutter 引擎
- progressive-web-apps - Blazor PWA 的问题
- swiftui - 如何以编程方式显示 SwiftUI 覆盖?
- vue.js - 谷歌地图在 Vue 模态中显示灰色框