Extracting the output layer of HuggingFace GPT2DoubleHeadsModel
Hello,

Suppose that I have two GPT2DoubleHeadsModel (let’s call it model A and B).
Is there any way that I can: 

1. take the hidden state of a given input at the n-th layer of the model A and feed it directly into the output layer of model B to compute output

AND

2. Take the output obtained from 1. and calculate the loss based on an appropriate label 

Some coding example would be a great help.

Thank you,

Please do not open duplicate issues (#1774)