I know that when training, if you are using BatchNorm and have only 1 sample in your batch, then it can error out, which makes sense.  I also know that you can use drop_last=True in your dataloader for those situations.  But BatchNorm aside, how does PyTorch handle incomplete batches in training and inference?  Is it able to deal with the different batch sizes or does it somehow pad the batch?
And the second part, similar question, does it matter at all if the size of your dataset is divisible by batch size when doing inference (validation/test)?