src/transformers/models/transfo_xl/modeling_tf_transfo_xl.py/TFTransfoXLForSequenceClassification/serving_output
class TFTransfoXLForSequenceClassification:    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 TFTransfoXLSequenceClassifierOutputWithPast(
            logits=output.logits, mems=tf.convert_to_tensor(output.mems), hidden_states=hs, attentions=attns
        )