class Model(nn.Module):
    def __init__(self, enc, bin, dec):
        super().__init__()
        self.enc = enc
        self.bin = bin
        self.dec = dec

    def forward(self, res, encoder_h_1, encoder_h_2, encoder_h_3):
            encoded, encoder_h_1, encoder_h_2, encoder_h_3 = self.enc(res, encoder_h_1, encoder_h_2, encoder_h_3)
            codes = self.bin(encoded)
            output, decoder_h_1, decoder_h_2, decoder_h_3, decoder_h_4 = self.dec(codes, decoder_h_1, decoder_h_2, decoder_h_3, decoder_h_4)
            return output

model = nn.DataParallel(Model(encoder, binarizer, decoder))

something like this.