Keras with TensorFlow support can do this easily. A functional API has been developed for these use cases. Take a look at the functional API guide. Here is an LSTM example that separates layers taken from the above guide:
When you train a Keras model with multiple outputs, you can define a loss function for each output, and Keras will optimize the sum of all losses, which is very useful.
source share