Split a model into multi gpu

I’m implementing a seq2seq model with multi gpus, in which encoder is in cuda:0 and decoder is in cuda:1. My forward process has passed.But the loss.backward() throws an error “RuntimeError: arguments are located on different GPUs” How can i do it

Is this a duplicate of this thread?
If not, could you post a code snippet so that we could have a look?