Commit 887e6042 authored by Adrian Kuegel's avatar Adrian Kuegel Committed by TensorFlower Gardener
Browse files

Make TopK stable on the GPU backend.

TopK op needs the guarantee that the sorting is stable. In that case, a
'values' parameter is passed which is a iota. We can use that to disambiguate
comparison ties to sort by original index, which makes the sorting stable.
Note that this still doesn't guarantee that the sort op is stable for all
inputs, just that it is stable when used by TopK.

PiperOrigin-RevId: 222390450
parent 7586bb3c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment