def METHOD_NAME(self):
    self.model.eval()
    losses = 0
    count = 0
    for src, tgt, src_lengths, tgt_lengths in self.valid_dl:
        tgt_in = torch.concat(
            [torch.full([tgt.shape[0], 1], BOS_IDX), tgt], dim=1)
        logits = self.model(src.to(self.device), tgt_in.to(self.device))
        loss = self.loss_fn(
            logits.to(self.loss_device),
            tgt.to(self.loss_device),
            src_lengths.to(self.loss_device),
            tgt_lengths.to(self.loss_device))
        losses += loss.item()
        count += 1
    return losses / count