Hmm wouldn’t the derivative of argsort be zero everywhere (except the points where two elements are tied, in which it wouldn’t be differentiable)?
What is your use case for something like this? Why not just perform argsort on a tensor that does not require grad?