MCPcopy Create free account
hub / github.com/MichSchli/AVeriTeC / test_step

Method test_step

models/NaiveSeqClassModule.py:98–111  ·  view source on GitHub ↗
(self, batch, batch_idx)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected