Make max op NaN propagation rules align with numpy

This commit is contained in:
Joona Havukainen
2025-07-06 14:27:40 -07:00
parent 0e0d9ac522
commit 0d30e9e8ec
2 changed files with 30 additions and 2 deletions

View File

@@ -1024,6 +1024,10 @@ TEST_CASE("test reduction ops") {
x = array({true, true, true, false, true, false}, {2, 3});
CHECK(array_equal(min(x, 1), array({true, false})).item<bool>());
CHECK(array_equal(min(x, 0), array({false, true, false})).item<bool>());
x = array({1.0f, NAN, 3.0f});
CHECK(isnan(max(x).item<float>()));
}
// Test logsumexp