The MNIST example 33 shown you a simple foop over your DataLoaders, while the ImageNet example 6 gives you some other utilities (e.g. only storing the best checkpoint).
You can store the outputs as numpy arrays using output.detach().cpu().numpy() and store them as a csv using e.g. np.savetxt("preds.csv", output, delimiter=",") or pandas.