The ONNX node reader scans only the root graph. PyPTO custom operators inside If, Loop, or Scan graph attributes are omitted, so deployment can fail to find any PyPTO operator or build a library that omits an operator used by a control-flow branch.
Reproduction
Construct a valid ONNX model with an If branch containing another If, and put a marked PyPTO custom operator in the inner branch. The deployment discovery path returns no PyPTO nodes. If a marked root operator is also present, it returns only the root operator.
Expected result
Every marked PyPTO node in the model should be discovered in graph order. The fix recursively visits GRAPH and GRAPHS attributes. A focused CPU harness using real ONNX protobuf objects confirms that nested-only and root-plus-nested models return the expected nodes.
[Bug-Report|缺陷反馈]: PyPTO ONNX discovery misses nested graph nodes
Problem
The ONNX node reader scans only the root graph. PyPTO custom operators inside
If,Loop, orScangraph attributes are omitted, so deployment can fail to find any PyPTO operator or build a library that omits an operator used by a control-flow branch.Reproduction
Construct a valid ONNX model with an
Ifbranch containing anotherIf, and put a marked PyPTO custom operator in the inner branch. The deployment discovery path returns no PyPTO nodes. If a marked root operator is also present, it returns only the root operator.Expected result
Every marked PyPTO node in the model should be discovered in graph order. The fix recursively visits
GRAPHandGRAPHSattributes. A focused CPU harness using real ONNX protobuf objects confirms that nested-only and root-plus-nested models return the expected nodes.