Skip to content

ENH: enhance nansum and nanmean to support complex arrays with torch on cpu - #1099

Open
qbarthelemy wants to merge 3 commits into
data-apis:mainfrom
qbarthelemy:nan_torch_cpu
Open

qbarthelemy wants to merge 3 commits into
data-apis:mainfrom
qbarthelemy:nan_torch_cpu

Conversation

@qbarthelemy

@qbarthelemy qbarthelemy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Reference issue

See comment pyRiemann/pyRiemann#465 (comment) of @viranovskaya

Related to issue #789

What does this implement/fix?

Currently, nansum and nanmean used with complex arrays with torch on CPU raise this error
RuntimeError: nansum does not support complex inputs

AI Generation Disclosure

Tests written by AI

@lucascolley

Copy link
Copy Markdown
Member

is there an upstream issue in torch we can link?

@qbarthelemy

qbarthelemy commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

is there an upstream issue in torch we can link?

At first glance, I didn't find anything. This behavior appears to be intentional.
See PyTorch ReduceOps.cpp, lines 1323–1327

@lucascolley

Copy link
Copy Markdown
Member

Alright, could you just include a permalink to those lines as a comment?

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants