Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
awni committed Jan 31, 2025
1 parent aadf66e commit eb9a9d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mlx/backend/common/indexing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,8 @@ void Scatter::eval_cpu(const std::vector<array>& inputs, array& out) {
auto& updates = inputs.back();

// Copy src into out (copy allocates memory for out)
copy(src, out, CopyType::General);
auto ctype = src.flags().row_contigous ? CopyType::Vector : CopyType::General;
copy(src, out, ctype);

switch (src.dtype()) {
case bool_:
Expand Down Expand Up @@ -621,7 +622,8 @@ void ScatterAxis::eval_cpu(const std::vector<array>& inputs, array& out) {
auto& updates = inputs[2];

// Copy src into out (copy allocates memory for out)
copy(src, out, CopyType::General);
auto ctype = src.flags().row_contigous ? CopyType::Vector : CopyType::General;
copy(src, out, ctype);

switch (src.dtype()) {
case bool_:
Expand Down

0 comments on commit eb9a9d5

Please sign in to comment.