Thanks!
I run to the same problem when using torch.sort(..., out=(sorted_c, indices)), and I get the error RuntimeError: sort(): functions with out=... arguments don't support automatic differentiation, but one of the arguments requires grad.
In the documentation 12 of torch.sort() it does not mention that out= can’t be used when one of the out arguments requires grad. Probably, it would be better to add this information to the documentation (if it is not already added somewhere).
I use Python 3.7.1 and Pytorch 1.0.0.
Thanks!