Using 10 separate forward passes and calling backward after averaging the loss should yield the same gradients. However, certain layers like nn.BatchNorm will behave differently, since the running estimates depend on the batch size.