python - 已经支持 autograd 的复杂函数 - Pytorch
问题描述
我正在使用这个自定义函数在自定义损失函数中重塑我的张量。
def reshape_fortran(x, shape):
if len(x.shape) > 0:
x = x.permute(*reversed(range(len(x.shape))))
return x.reshape(*reversed(shape)).permute(*reversed(range(len(shape))))
虽然,我收到此错误:
RuntimeError: _unsafe_view does not support automatic differentiation for outputs with complex dtype.
用于reshape_fortran
输出。
你知道可能是什么问题吗?Pytorch autograd 不支持哪个函数用于复数?
解决方案
Complex Autograd 在 1.8 版中处于 Beta 版,但现在已经稳定,应该完全支持1.9版的此类操作。
推荐阅读
- c# - 如何解决 AddJsonOptions 不包含 SerializerSettings - .NET 的定义
- c# - WPF C#错误的鼠标坐标
- google-cloud-storage - 使用 CMEK 和 Cloud Storage 限制 Cloud KMS 密钥的加密/解密权限
- ajax - laravel 中 fill() 和 update() 的区别
- python - 来自flask_wtf FlaskForm的form.validate_on_submit()不起作用
- c# - 如何在表单提交后显示从下拉列表中选择的值
- sql - 在sql查询中选择最大日期列,该列连接到其他列
- javascript - 如何对 ReactJs 输入进行 onEndEditing
- python - 无法导入熊猫 (pandas._libs.window.aggregations)
- video - ffplay:显示时间戳(暂停时)