def METHOD_NAME(self, batch):
    self.msg = "Valid: Rank: {}, ".format(dist.get_rank())
    losses_dict = {}
    loss, attention_loss, ctc_loss = self.model(*batch[1:])
    if paddle.isfinite(loss):
        num_utts = batch[1].shape[0]
        self.num_seen_utts += num_utts
        self.total_loss += float(loss) * num_utts
        losses_dict['loss'] = float(loss)
        if attention_loss:
            losses_dict['att_loss'] = float(attention_loss)
        if ctc_loss:
            losses_dict['ctc_loss'] = float(ctc_loss)
        for k, v in losses_dict.items():
            report("eval/" + k, v)
    self.msg += ', '.join('{}: {:>.6f}'.format(k, v)
                          for k, v in losses_dict.items())
    logger.info(self.msg)
    return self.total_loss, self.num_seen_utts