Skip to content

fix: NaN assertion uses .all() instead of .any() - #908

Closed
Mr-Neutr0n wants to merge 1 commit into
CompVis:mainfrom
Mr-Neutr0n:fix/nan-assertion-any-vs-all
Closed

fix: NaN assertion uses .all() instead of .any()#908
Mr-Neutr0n wants to merge 1 commit into
CompVis:mainfrom
Mr-Neutr0n:fix/nan-assertion-any-vs-all

Conversation

@Mr-Neutr0n

Copy link
Copy Markdown

Bug

The NaN assertion assert not torch.isnan(x).all() only triggers when ALL values are NaN. The intended check is to catch ANY NaN values, which requires .any().

Fix

Changed .all() to .any() so the assertion catches any NaN values.

@Mr-Neutr0n

Copy link
Copy Markdown
Author

Quick ping on the one-line fix in ddpm.py that corrects the NaN assertion from .all() to .any(). As written, np.all() only flags a NaN if every element is NaN, so a partially NaN tensor would pass through undetected. Would a maintainer be able to take a look?

@Mr-Neutr0n

Copy link
Copy Markdown
Author

Closing this one to tidy up my open pull requests.

It's been open around five months with no review activity, and I'd rather withdraw it than leave it sitting in your queue. Nothing needed from you, and no hard feelings at all.

If the fix is still wanted, this can be reopened, or I'm happy to redo it properly against current main. Apologies for the noise.

@Mr-Neutr0n Mr-Neutr0n closed this Jul 28, 2026
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.

1 participant