ONNX003: unsorted-graph-nodes

Code: ONNX003

Name: unsorted-graph-nodes

Severity: error

Category: spec

Target: graph

Fixable: 🔧 Yes

Message

Graph nodes are not in topological order.

Suggestion

Sort the nodes in topological order with graph.sort().

Details

Nodes within a graph must be in topologically sorted order, meaning every node’s inputs must be produced by a preceding node or be a graph input.

Example

graph.sort()