In case you would like to create the predictions for a dataset, using a DataLoader sounds like a good approach. On the other hand, if you would like to get a prediction of a single sample, you could directly pass it to the model, so the “best” approach depends a bit on your use case.