yobx.torch.coverage.op_coverage#

Op-db coverage data for PyTorch-to-ONNX operator export.

Defines the sets of ops that have no converter, are known to fail, or are excluded for specific dtypes when tested via unittests.torch.coverage.test_onnx_export_common_methods.

NO_CONVERTER_OPS - ops whose aten decomposition uses a function for which no ONNX converter has been implemented yet.

XFAIL_OPS - ops that can be exported but produce incorrect numerical results or raise errors unrelated to missing converters.

XFAIL_OPS_FLOAT16, XFAIL_OPS_BFLOAT16, XFAIL_OPS_INT32, XFAIL_OPS_INT64 - dtype-specific extra exclusions on top of XFAIL_OPS.

ATOL_OPS_FLOAT32, ATOL_OPS_FLOAT16, ATOL_OPS_BFLOAT16 - per-op absolute tolerance overrides for float16 and bfloat16, for ops whose reduced-precision errors exceed the global dtype tolerance.

These sets are consumed by the op-db test module unittests.torch.coverage.test_onnx_export_common_methods and by get_op_coverage_rst() which builds a documentation coverage table.

yobx.torch.coverage.op_coverage.get_op_coverage_rst() str[source]#

Returns an RST table showing op-db coverage per op and dtype.

Queries torch.testing._internal.common_methods_invocations.op_db and builds a grid showing, for every op and dtype combination, whether the op is:

  • - in the tested set (converter exists, no known failure for that dtype),

  • xfail - converter exists but the test is a known failure,

  • no converter - no ONNX converter has been implemented yet, or

  • - the op does not support that dtype.

Returns:

RST source string (a list-table directive) ready to be printed inside a .. runpython:: block with :rst: enabled.