mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-01 12:49:44 +08:00
Fix out-of-bounds default value in logsumexp/softmax (#2213)
This commit is contained in:
@@ -1036,6 +1036,9 @@ TEST_CASE("test reduction ops") {
|
||||
x = array({-inf, -inf});
|
||||
CHECK_EQ(logsumexp(x).item<float>(), -inf);
|
||||
|
||||
x = repeat(array(-inf), 5000);
|
||||
CHECK_EQ(logsumexp(x).item<float>(), -inf);
|
||||
|
||||
x = array({0.0f, -inf});
|
||||
CHECK_EQ(logsumexp(x).item<float>(), 0.0f);
|
||||
|
||||
|
Reference in New Issue
Block a user