src/transformers/models/longformer/modeling_tf_longformer.py/TFLongformerForSequenceClassification/serving_output
class TFLongformerForSequenceClassification:    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
        g_attns = tf.convert_to_tensor(output.global_attentions) if self.config.output_attentions else None

        return TFLongformerSequenceClassifierOutput(
            logits=output.logits, hidden_states=hs, attentions=attns, global_attentions=g_attns
        )