Skip to content

Commit abf41dc

Browse files
committed
more mypy hints
1 parent 6e1e44b commit abf41dc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pytensor/graph/replace.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from functools import partial
22
from typing import Iterable, Optional, Sequence, Union, cast, overload
33

4-
from pytensor.graph.basic import Constant, Variable, truncated_graph_inputs
4+
from pytensor.graph.basic import Apply, Constant, Variable, truncated_graph_inputs
55
from pytensor.graph.fg import FunctionGraph
66

77

@@ -175,7 +175,9 @@ def graph_replace(
175175
raise ValueError(f"Some replacements were not used: {non_fg_replace}")
176176
toposort = fg.toposort()
177177

178-
def toposort_key(fg: FunctionGraph, ts, pair):
178+
def toposort_key(
179+
fg: FunctionGraph, ts: list[Apply], pair: tuple[Variable, Variable]
180+
) -> int:
179181
key, _ = pair
180182
if key.owner is not None:
181183
return ts.index(key.owner)

0 commit comments

Comments
 (0)