How to define multiple decoders for the same encoder

The branches and the encoder has to be optimised simultaneously.