src/transformers/models/dpr/modeling_tf_dpr.py/TFDPRReader/serving_output
class TFDPRReader:    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 TFDPRReaderOutput(
            start_logits=output.start_logits,
            end_logits=output.end_logits,
            relevance_logits=output.relevance_logits,
            hidden_states=hs,
            attentions=attns,
        )