PyTorch won’t switch to the CPU without manually specifying the device so it seems you are still executing CPU operations.
'sort' of 'numpy.ndarray' objects indeed points to a numpy operation, which will be executed on the CPU.