onnx_light.onnx.checker#

exception onnx_light.onnx.checker.ValidationError#
onnx_light.onnx.checker.check_attribute(attribute: _C.AttributeProto) None#

Checks an attribute and raises checker.ValidationError on invalid content.

Raises:

ValidationError – If the attribute is invalid.

onnx_light.onnx.checker.check_graph(graph: GraphProto) None#

Checks a graph and raises checker.ValidationError on invalid content.

Raises:

ValidationError – If the graph is invalid.

onnx_light.onnx.checker.check_model(model: _C.ModelProto, *, full_check: bool = False, skip_opset_compatibility_check: bool = False, check_custom_domain: bool = False, skip_external_data_location_check: bool = False) None#

Checks a model and raises checker.ValidationError on invalid content.

Validates the model’s IR structure, including topological ordering of nodes, SSA form, schema compliance, and metadata consistency.

When skip_external_data_location_check is True, the validation of external tensor data locations is skipped, bypassing errors such as an empty or unsafe location. This is not recommended and must never be the default: it disables safety checks that guard against unsafe external data paths.

Raises:

ValidationError – If the model fails validation.

onnx_light.onnx.checker.check_sparse_tensor(sparse_tensor: SparseTensorProto) None#

Checks a sparse tensor and raises checker.ValidationError on invalid content.

Raises:

ValidationError – If the sparse tensor is invalid.