If you don’t want to derive from nn.Module, you might have to implement the parallel calls manually using the functional API, as the vanilla nn.DataParallel uses the nn.Module.forward method to chunk the data etc.