determinant of a complex matrix in PyTorch
问题 Is there a way to calculate the determinant of a complex matrix in PyTroch? torch.det is not implemented for 'ComplexFloat' 回答1: Unfortunately it's not implemented currently. One way would be to implement your own version or simply use np.linalg.det . Here is a short function which computes the determinant of a complex matrix that I wrote using LU-decomposition: def complex_det(A): def complex_diag(A): return torch.view_as_complex(torch.stack((A.real.diag(), A.imag.diag()),dim=1)) #Perform LU