MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / _on_fetches

Method _on_fetches

tensorpack/callbacks/inference.py:168–174  ·  view source on GitHub ↗
(self, outputs)

Source from the content-addressed store, hash-verified

166 return [self.wrong_tensor_name]
167
168 def _on_fetches(self, outputs):
169 vec = outputs[0]
170 # TODO put shape assertion into inference-runner
171 assert vec.ndim == 1, "{} is not a vector!".format(self.wrong_tensor_name)
172 batch_size = len(vec)
173 wrong = np.sum(vec)
174 self.err_stat.feed(wrong, batch_size)
175
176 def _after_inference(self):
177 return {self.summary_name: self.err_stat.ratio}

Callers

nothing calls this directly

Calls 3

formatMethod · 0.80
sumMethod · 0.80
feedMethod · 0.45

Tested by

no test coverage detected