Skip to content

Commit 87653ca

Browse files
authored
Fix argmax. Higher index should also be taken into account (#3179)
1 parent bf3d3f2 commit 87653ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

candle-metal-kernels/src/metal_src/reduce.metal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ constexpr METAL_FUNC bool operator<(indexed<T> lhs, indexed<T> rhs) {
100100

101101
template<typename T>
102102
constexpr METAL_FUNC bool operator>(indexed<T> lhs, indexed<T> rhs) {
103-
return lhs.val > rhs.val || (lhs.val == rhs.val && lhs.i < rhs.i);
103+
return lhs.val > rhs.val || (lhs.val == rhs.val && lhs.i > rhs.i);
104104
}
105105

106106
template<typename T>

0 commit comments

Comments
 (0)