MCPcopy
hub / github.com/HIT-SCIR/ltp / test_step

Method test_step

python/core/ltp_core/models/lit_model.py:169–181  ·  view source on GitHub ↗
(self, batch: Any, batch_idx: int, dataloader_idx=0)

Source from the content-addressed store, hash-verified

167 self.mean_metrics.reset()
168
169 def test_step(self, batch: Any, batch_idx: int, dataloader_idx=0):
170 task_name = self.task_list[dataloader_idx]
171 loss, outputs = self.step(task_name, batch)
172
173 # log test metrics
174 self.test_metrics[task_name].update(outputs, **batch)
175 self.log(
176 f"test/{task_name}/loss",
177 loss,
178 on_step=False,
179 on_epoch=True,
180 add_dataloader_idx=False,
181 )
182
183 def test_epoch_end(self, outputs: List[Any]):
184 for metric in self.test_metrics.values():

Callers

nothing calls this directly

Calls 2

stepMethod · 0.95
updateMethod · 0.45

Tested by

no test coverage detected