Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not perform inplace sort
Browse files Browse the repository at this point in the history
guoqingbao committed Jan 27, 2025
1 parent 1625938 commit af24795
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions candle-core/src/sort.rs
Original file line number Diff line number Diff line change
@@ -328,9 +328,8 @@ impl Tensor {
op: "sort_last_dim",
});
}
let asort = self.arg_sort_last_dim(asc)?;
// let sorted = self.gather(&asort, crate::D::Minus1)?;
let sorted = self.clone();
let sorted = self.copy()?;
let asort = sorted.arg_sort_last_dim(asc)?;
Ok((sorted, asort))
}
}

0 comments on commit af24795

Please sign in to comment.