boundlab.diff.diff_net#

boundlab.diff.diff_net(net1, net2)[source]#

Pair the initializers of two structurally identical ONNX models.

Parameters:
  • net1 (Model | str | Path) – Models with the same node sequence and input arities. Each may be an onnx_ir.Model, a str, or a pathlib.Path.

  • net2 (Model | str | Path) – Models with the same node sequence and input arities. Each may be an onnx_ir.Model, a str, or a pathlib.Path.

Returns:

  • A merged onnx_ir.Model whose paired parameters flow through

  • boundlab::DiffPair nodes.

Raises:

ValueError – If the two graphs differ in node count, node type, or input arity.

Return type:

Model