I am working on training a Variational Autoencoder(VAE) for disentangling features of variation from a dataset. In order to do that, encode and decode layers of VAE are used separately while defining the loss function; since common factor of two images with same label in the dataset are replaced. Using such method, only one GPU is being used while using DataParallel on my model. I have trained other models on my current setup which successfully use both GPUs. How can I correct this? I also found a somewhat relevant question on discussion page of pytorch but without any answers here.