src/transformers/models/xlnet/modeling_tf_xlnet.py/TFXLNetForQuestionAnsweringSimple/serving_output
class TFXLNetForQuestionAnsweringSimple:    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
        mems = tf.convert_to_tensor(output.mems) if output.mems is not None else None

        return TFXLNetForQuestionAnsweringSimpleOutput(
            start_logits=output.start_logits,
            end_logits=output.end_logits,
            mems=mems,
            hidden_states=hs,
            attentions=attns,
        )