yobx.reference.report_results_comparison#
- class yobx.reference.report_results_comparison.ReportResultComparison(tensors: Dict[str | Tuple[str, int, str], torch.Tensor])[source]#
Holds tensors a runtime can use as a reference to compare intermediate results. See
yobx.reference..torch_evaluator.TorchReferenceEvaluator.run().- Parameters:
tensors – tensor
- key(tensor: torch.Tensor) Tuple[int, Tuple[int, ...]][source]#
Returns a key for a tensor, (onnx dtype, shape).
- report(outputs: Dict[str, torch.Tensor]) List[Tuple[Tuple[int, str], str | Tuple[str, int, str], Dict[str, float | str]]][source]#
For every tensor in outputs, compares it to every tensor held by this class if it shares the same type and shape. The function returns the results of the comparison. The function also collects the results into a dictionary the user can retrieve later.