Yes, I use Dataset and dataloader class from pytorch. You can viewed the model comprising a feature extractor and a classifier which works in an E2E manner. For both labeled and unlabeled data mixed together to do forward propagation,  however, you can view it as we use the whole data for feature extraction, but only labeled data was used for classificaion.