src/transformers/models/openai/modeling_tf_openai.py/TFOpenAIGPTDoubleHeadsModel/serving_output
class TFOpenAIGPTDoubleHeadsModel:    def serving_output(self, output):
        hs = tf.convert_to_tensor(output.hidden_states) if self.config.output_hidden_states else None
        attns = tf.convert_to_tensor(output.attentions) if self.config.output_attentions else None

        return TFOpenAIGPTDoubleHeadsModelOutput(
            logits=output.logits, mc_logits=output.mc_logits, hidden_states=hs, attentions=attns
        )