mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
Improve the cpp unittest
This commit is contained in:
@@ -1025,8 +1025,9 @@ TEST_CASE("test reduction ops") {
|
|||||||
CHECK(array_equal(min(x, 1), array({true, false})).item<bool>());
|
CHECK(array_equal(min(x, 1), array({true, false})).item<bool>());
|
||||||
CHECK(array_equal(min(x, 0), array({false, true, false})).item<bool>());
|
CHECK(array_equal(min(x, 0), array({false, true, false})).item<bool>());
|
||||||
|
|
||||||
x = array({1.0f, NAN, 3.0f, 4.0f, 5.0f, 6.0f});
|
x = array({1.0f, NAN, 3.0f, 4.0f, 5.0f, 6.0f}, {2, 3});
|
||||||
CHECK(isnan(max(x).item<float>()));
|
CHECK(array_equal(max(x, 0), array({4.0f, NAN, 6.0f}), true).item<bool>());
|
||||||
|
CHECK(array_equal(max(x, 1), array({NAN, 6.0f}), true).item<bool>());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test logsumexp
|
// Test logsumexp
|
||||||
|
|||||||
Reference in New Issue
Block a user