This sounds like a standard problem: Writing a model for single samples. But on training mini-batches should be the default input for the model.
Is there something like myTrainModel = torch.convertForBatchInputs(myInferenceModel)