(self, batch)
| 109 | return torch.mean(torch.stack(losses, dim=0), dim=0) |
| 110 | |
| 111 | def eval_on_batch(self, batch): |
| 112 | mean_loss = self.compute_loss(batch).item() |
| 113 | batch_size = len(batch) |
| 114 | result = {'loss': mean_loss * batch_size, 'total': batch_size} |
| 115 | return result |
| 116 | |
| 117 | def begin_inference(self, orig_item, preproc_item): |
| 118 | ## TODO: Don't hardcode train |
no test coverage detected