POT
POT copied to clipboard
fix: check for NaNs in emd loss matrix
Types of changes
This PR introduces an additional check for NaN
s in the loss matrix of the emd computation. If NaN
s are detected we raise an error in order to protect against segfaults in the C++ backend.
Motivation and context / Related issue
The motivation of this PR is to fail more gracefully in cases of NaN
costs.
Closes #469
How has this been tested (if it applies)
Added new tests.
PR checklist
- [ ] I have read the CONTRIBUTING document.
- [x] The documentation is up-to-date with the changes I made (check build artifacts).
- [x] All tests passed, and additional code has been covered with new tests.
- [ ] I have added the PR and Issue fix to the RELEASES.md file.
⚠️ Some notes on the checklist above:
- I did not find a
CONTRIBUTING.md
- While I ran all related tests, I did not run the entire suite (due to some modules missing on my system). I assume the entire suite is run in the CI?
- Please let me know if this is something you would like a release issue for. If so please let me know.