Pytorch Pytork error isDifferentiableType(variable.scalar_type())用于计算复矩阵的det
跟进 当我想使用Pytorch Pytork error isDifferentiableType(variable.scalar_type())用于计算复矩阵的det,pytorch,complex-numbers,determinants,Pytorch,Complex Numbers,Determinants,跟进 当我想使用complex_det函数计算复矩阵的det时,我会遇到以下错误: RuntimeError: isDifferentiableType(variable.scalar_type()) INTERNAL ASSERT FAILED at "/pytorch/torch/csrc/autograd/functions/utils.h":59, please report a bug to PyTorch. 你知道我怎么修吗 <ipython-input
complex_det
函数计算复矩阵的det时,我会遇到以下错误:
RuntimeError: isDifferentiableType(variable.scalar_type()) INTERNAL ASSERT FAILED at "/pytorch/torch/csrc/autograd/functions/utils.h":59, please report a bug to PyTorch.
你知道我怎么修吗
<ipython-input-76-246d142f8871> in complex_det(A)
3 return torch.view_as_complex(torch.stack((A.real.diag(), A.imag.diag()),dim=1))
4 #Perform LU decomposition to matrix A:
----> 5 A_LU, pivots = A.lu()
6 P, A_L, A_U = torch.lu_unpack(A_LU, pivots)
7 #Det. of multiplied matrices is multiplcation of det.:
/usr/local/lib/python3.6/dist-packages/torch/tensor.py in lu(self, pivot, get_infos)
332 r"""See :func:`torch.lu`"""
333 # If get_infos is True, then we don't need to check for errors and vice versa
--> 334 LU, pivots, infos = torch._lu_with_info(self, pivot=pivot, check_errors=(not get_infos))
335 if get_infos:
336 return LU, pivots, infos
复杂数据中的(A)
3返回torch.view作为复合物(torch.stack((A.real.diag(),A.imag.diag()),dim=1))
4#对矩阵A进行LU分解:
---->5 A_LU,支点=A.LU()
6 P,A_L,A_=火炬。打开包装(A_,枢轴)
7#被乘矩阵的Det是Det的乘积:
/lu中的usr/local/lib/python3.6/dist-packages/torch/tensor.py(self、pivot、get_infos)
332 r“”“参见:func:`torch.lu`”
333#如果get#u infos为真,则不需要检查错误,反之亦然
-->334 LU,pivots,infos=torch.\u LU\u与\u信息(self,pivot=pivot,check\u errors=(not get\u infos))
335如果获取信息:
336返回LU、枢轴、信息