I had exactly the same question too. And I suppose it should be called GD but neither SGD nor BGD(batch gradient descent).
What the nn.optim.SGD optimizer really does is to perform a step of gradient descent algorithm once optimzer.step() is called.

The stochastic or random part is done in the DataLoader. We’ve done shuffle in the DataLoader and then the GD algorithm is an SGD algorithm.
The batch part is done both in the DataLoader and the loss function. We’ve assigned a batch_size to the DataLoader and well tell the loss function, take L1_loss as an example, that we want a mean loss or a sum loss for the whole batch.

So, the SGD optimizer has nothing to do with neither the random part nor the batch part. It is only just a GD algorithm or a GD stepper.