If you are using a batch size of 1, you wouldn’t need the loop, so there wouldn’t be a difference.
However, if your batch size is e.g. 64, it would make a difference to loop over each sample or pass the batch directly to the model.