-
Notifications
You must be signed in to change notification settings - Fork 53
Add complex number support to linalg.slogdet
#567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think that that's mostly a terminology thing? The implementations are consistent: >>> x = np.array([[0.1+0.9j, 0.5-0.5j], [1, 2j]])
>>> np.linalg.slogdet(x)
((-0.9566738804288585+0.29116161578269606j), 0.877201841342143)
>>> torch.linalg.slogdet(torch.as_tensor(x))
torch.return_types.linalg_slogdet(
sign=tensor(-0.9567+0.2912j, dtype=torch.complex128),
logabsdet=tensor(0.8772, dtype=torch.float64)) If there's something to clarify or improve in the PyTorch wording in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes here LGTM, thanks @kgryte
I agree that the term angle is not correct. The quantity that's returned in PyTorch is indeed the sign, and the rest of the docs and the implementation are consistent with this. I'll fix that in the PyTorch docs soon. |
This issue was raised in data-apis/array-api#567 [ghstack-poisoned]
This issue was raised in data-apis/array-api#567 ghstack-source-id: e9cd318cd8957215c5672925298ad86c97fe3283 Pull Request resolved: #91129
This issue was raised in data-apis/array-api#567 Pull Request resolved: #91129 Approved by: https://github.com/kit1980
This PR
linalg.slogdet
.sign
#556. In contrast to itssign
function, NumPy uses the definitionsign
array be the same data type as the input array andlogabsdet
be unconditionally real-valued.