mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-18 15:28:16 +08:00
Chore: Add default language in pre-commit and bump hooks (#1652)
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
default_language_version:
|
||||
python: python3.10
|
||||
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v18.1.8
|
||||
rev: v19.1.4
|
||||
hooks:
|
||||
- id: clang-format
|
||||
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: 24.8.0
|
||||
rev: 24.10.0
|
||||
hooks:
|
||||
- id: black
|
||||
|
||||
- repo: https://github.com/pycqa/isort
|
||||
rev: 5.13.2
|
||||
hooks:
|
||||
|
@@ -129,37 +129,59 @@ TEST_CASE("test array types") {
|
||||
}
|
||||
|
||||
// uint8
|
||||
{ basic_dtype_test(uint8_t, uint8); }
|
||||
{
|
||||
basic_dtype_test(uint8_t, uint8);
|
||||
}
|
||||
|
||||
// uint16
|
||||
{ basic_dtype_test(uint16_t, uint16); }
|
||||
{
|
||||
basic_dtype_test(uint16_t, uint16);
|
||||
}
|
||||
|
||||
// uint32
|
||||
{ basic_dtype_test(uint32_t, uint32); }
|
||||
{
|
||||
basic_dtype_test(uint32_t, uint32);
|
||||
}
|
||||
|
||||
// uint64
|
||||
{ basic_dtype_test(uint64_t, uint64); }
|
||||
{
|
||||
basic_dtype_test(uint64_t, uint64);
|
||||
}
|
||||
|
||||
// int8
|
||||
{ basic_dtype_test(int8_t, int8); }
|
||||
{
|
||||
basic_dtype_test(int8_t, int8);
|
||||
}
|
||||
|
||||
// int16
|
||||
{ basic_dtype_test(int16_t, int16); }
|
||||
{
|
||||
basic_dtype_test(int16_t, int16);
|
||||
}
|
||||
|
||||
// int32
|
||||
{ basic_dtype_test(int32_t, int32); }
|
||||
{
|
||||
basic_dtype_test(int32_t, int32);
|
||||
}
|
||||
|
||||
// int64
|
||||
{ basic_dtype_test(int64_t, int64); }
|
||||
{
|
||||
basic_dtype_test(int64_t, int64);
|
||||
}
|
||||
|
||||
// float16
|
||||
{ basic_dtype_test(float16_t, float16); }
|
||||
{
|
||||
basic_dtype_test(float16_t, float16);
|
||||
}
|
||||
|
||||
// float32
|
||||
{ basic_dtype_test(float, float32); }
|
||||
{
|
||||
basic_dtype_test(float, float32);
|
||||
}
|
||||
|
||||
// bfloat16
|
||||
{ basic_dtype_test(bfloat16_t, bfloat16); }
|
||||
{
|
||||
basic_dtype_test(bfloat16_t, bfloat16);
|
||||
}
|
||||
|
||||
#undef basic_dtype_test
|
||||
|
||||
|
@@ -3045,13 +3045,17 @@ TEST_CASE("test divmod") {
|
||||
|
||||
// Check that we can still eval when one output goes out of scope
|
||||
std::vector<array> out_holder;
|
||||
{ out_holder.push_back(divmod(x, y)[0]); }
|
||||
{
|
||||
out_holder.push_back(divmod(x, y)[0]);
|
||||
}
|
||||
eval(out_holder);
|
||||
CHECK_EQ(out_holder[0].item<float>(), 0.0);
|
||||
|
||||
// Check that we can still eval when the other output goes out of scope
|
||||
out_holder.clear();
|
||||
{ out_holder.push_back(divmod(x, y)[1]); }
|
||||
{
|
||||
out_holder.push_back(divmod(x, y)[1]);
|
||||
}
|
||||
eval(out_holder);
|
||||
CHECK_EQ(out_holder[0].item<float>(), 1.0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user