Skip to content

Commit 1745761

Browse files
committed
type
1 parent 081ae34 commit 1745761

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

onnxscript/ir/_core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,15 +2162,15 @@ def sort(self) -> None:
21622162
21632163
This sort is stable. It preserves the original order as much as possible.
21642164
2165-
Referece: https://github.com/madelson/MedallionTopologicalSort#stable-sort
2165+
Reference: https://github.com/madelson/MedallionTopologicalSort#stable-sort
21662166
21672167
Raises:
21682168
ValueError: If the graph contains a cycle, making topological sorting impossible.
21692169
"""
21702170
# Obtain all nodes from the graph and its subgraphs for sorting
21712171
nodes = list(onnxscript.ir.traversal.RecursiveGraphIterator(self))
21722172
# Store the sorted nodes of each subgraph
2173-
sorted_nodes_by_graph: dict[Graph, list[Node]] = {
2173+
sorted_nodes_by_graph: dict[Graph | Function, list[Node]] = {
21742174
graph: [] for graph in {node.graph for node in nodes if node.graph is not None}
21752175
}
21762176
# TODO: Explain why we need to store direct predecessors and children and why
@@ -2193,7 +2193,7 @@ def add_predecessor(child: Node, predecessor: Node | None) -> None:
21932193
node_depth[predecessor] += 1
21942194

21952195
# 1. Build the direct predecessors of each node and the depth of each node
2196-
# for sorting topolocally using Kahn's algorithm.
2196+
# for sorting topologically using Kahn's algorithm.
21972197
# Note that when a node contains graph attributes (aka. has subgraphs),
21982198
# we consider all nodes in the subgraphs *predecessors* of this node. This
21992199
# way we ensure the implicit dependencies of the subgraphs are captured

0 commit comments

Comments
 (0)