mirror of
https://github.com/ml-explore/mlx.git
synced 2025-09-19 02:38:09 +08:00
Return empty array when repeats is 0 in mx.repeat (#681)
* Return empty array when repeats is 0 * Add test case for repeats = 0
This commit is contained in:
@@ -774,7 +774,7 @@ array repeat(const array& arr, int repeats, int axis, StreamOrDevice s) {
|
||||
}
|
||||
|
||||
if (repeats == 0) {
|
||||
return array({}, arr.dtype());
|
||||
return array(std::initializer_list<int>{}, arr.dtype());
|
||||
}
|
||||
|
||||
if (repeats == 1) {
|
||||
|
Reference in New Issue
Block a user