(self, batch, batch_idx)
| 96 | |
| 97 | |
| 98 | def test_step(self, batch, batch_idx): |
| 99 | x, x_mask, y = batch |
| 100 | |
| 101 | outputs = self(x, attention_mask=x_mask) |
| 102 | logits = outputs.logits |
| 103 | |
| 104 | preds = torch.argmax(logits, axis=1) |
| 105 | |
| 106 | if not self.use_question_stance_approach: |
| 107 | self.test_acc(preds, y) |
| 108 | self.log('test_acc_step', self.test_acc) |
| 109 | self.test_f1(preds, y) |
| 110 | |
| 111 | return {"src": x, "pred": preds, "target": y} |
| 112 | |
| 113 | def test_epoch_end(self, outs): |
| 114 | if self.use_question_stance_approach: |
nothing calls this directly
no outgoing calls
no test coverage detected