@klory the code runs without problems  on gpu without nn.DataParallel. The problem seems to be the torch.distributions.Laplace that I call in the forward pass. Is there any reason this should be a problem?
Also my model consists of different nn.Modules: an encoder and a decoder for each modality. Is this compatible with nn.DataParallel?