How to shuffle input data using stochastic gradient decent?
If I understand your question correctly, I would advise you not to spend time on this.

If you have data that has a structural order to it, for example time-series data where each sample follows from the previous, then shuffling would be throwing that information away.

If your data is not sequential, on the other hand, then computing all possible permutations and training the model on each of them is really just a waste of time. We shuffle the data e.g. to prevent a powerful model from trying to learn some sequence from the data, which doesn't exist.

Training a model on all permutations might be a way to uncover the correct order of the data, is you know it has an order, but it was already shuffled. Otherwise, this experiment would be as useful as training the same model $(n^2)!$ times, just using a different random seem each time.

Have a look here for some more points on shuffling data and why we might do it. Here is more discussion on shuffling input samples.