mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-20 01:18:12 +08:00
iinfo and scalar overflow detection (#2009)
This commit is contained in:
@@ -55,3 +55,13 @@ TEST_CASE("test finfo") {
|
||||
CHECK_EQ(finfo(float16).min, -65504);
|
||||
CHECK_EQ(finfo(float16).max, 65504);
|
||||
}
|
||||
|
||||
TEST_CASE("test iinfo") {
|
||||
CHECK_EQ(iinfo(int8).dtype, int8);
|
||||
CHECK_EQ(iinfo(int64).dtype, int64);
|
||||
CHECK_EQ(iinfo(int64).max, std::numeric_limits<int64_t>::max());
|
||||
CHECK_EQ(iinfo(uint64).max, std::numeric_limits<uint64_t>::max());
|
||||
CHECK_EQ(iinfo(uint64).max, std::numeric_limits<uint64_t>::max());
|
||||
CHECK_EQ(iinfo(uint64).min, 0);
|
||||
CHECK_EQ(iinfo(int64).min, std::numeric_limits<int64_t>::min());
|
||||
}
|
||||
|
Reference in New Issue
Block a user