Skip to content

Fix binary_crossentropy dtypes and slogdet sign on Metal - #76

Merged
hertschuh merged 1 commit into
mainfrom
slogdet-sign
Oct 2, 2026
Merged

hertschuh merged 1 commit into
mainfrom
slogdet-sign

Conversation

@MarcosAsh

Copy link
Copy Markdown
Collaborator

This turns main green again after keras pluggable_backend moved to aca7bf905. It fixes two unrelated things:

  • binary_crossentropy casts its inputs to a float dtype like torch does (keras#23663). A bool target failed on mlx's negative.
  • slogdet divides the real and imaginary parts separately. mlx 0.32.3's Metal complex division gives nan for a tiny divisor, so the sign came out nan on macOS.

They're in one PR because each alone leaves the other leg red.

@hertschuh hertschuh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

@hertschuh
hertschuh merged commit db8347d into main Oct 2, 2026
10 checks passed
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