onnx.backend¶
Backend¶
- class onnx.backend.base.Backend[source]¶
- classmethod run_node(node: NodeProto, inputs: Any, device: str = 'CPU', outputs_info: Optional[Sequence[Tuple[dtype, Tuple[int, ...]]]] = None, **kwargs: Dict[str, Any]) Optional[Tuple[Any, ...]] [source]¶
Simple run one operator and return the results. :param outputs_info: a list of tuples, which contains the element type and :param shape of each output. First element of the tuple is the dtype: :param and: :param the second element is the shape. More use case can be found in: :param https: //github.com/onnx/onnx/blob/main/onnx/backend/test/runner/__init__.py
BackendRep¶
collect_snippets¶
Device¶
DeviceType¶
load_model_tests¶
Runner¶
- class onnx.backend.test.runner.Runner(backend: Type[Backend], parent_module: Optional[str] = None)[source]¶
- property test_cases: Dict[str, Type[TestCase]]¶
List of test cases to be applied on the parent scope Example usage:
globals().update(BackendTest(backend).test_cases)
- property test_suite: TestSuite¶
TestSuite that can be run by TestRunner Example usage:
unittest.TextTestRunner().run(BackendTest(backend).test_suite)
TestCase¶
- class onnx.backend.test.case.test_case.TestCase(name: str, model_name: str, url: Optional[str], model_dir: Optional[str], model: Optional[onnx.onnx_ml_pb2.ModelProto], data_sets: Optional[Sequence[Tuple[Sequence[numpy.ndarray], Sequence[numpy.ndarray]]]], kind: str, rtol: float, atol: float, __test__: bool = False)[source]¶