def METHOD_NAME(self, Q, D):
    Q = self.query(*Q)
    D, D_mask = self.doc(*D, keep_dims='return_mask')
    # Repeat each query encoding for every corresponding document.
    Q_duplicated = Q.repeat_interleave(self.colbert_config.nway, dim=0).contiguous()
    scores = self.score(Q_duplicated, D, D_mask)
    if self.colbert_config.use_ib_negatives:
        ib_loss = self.compute_ib_loss(Q, D, D_mask)
        return scores, ib_loss
    return scores