Skip to content

Commit c7a99b6

Browse files
ArmavicaricardoV94
authored andcommitted
Remove OrderedDict from graph/fg
1 parent 3b5bd37 commit c7a99b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pytensor/graph/fg.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""A container for specifying and manipulating a graph with distinct inputs and outputs."""
22

33
import time
4-
from collections import OrderedDict, defaultdict
4+
from collections import defaultdict
55
from collections.abc import Iterable, Sequence
66
from typing import TYPE_CHECKING, Any, Literal, Union, cast
77

@@ -768,12 +768,12 @@ def orderings(self) -> dict[Apply, list[Apply]]:
768768
769769
"""
770770
assert isinstance(self._features, list)
771-
all_orderings: list[OrderedDict] = []
771+
all_orderings: list[dict] = []
772772

773773
for feature in self._features:
774774
if hasattr(feature, "orderings"):
775775
orderings = feature.orderings(self)
776-
if not isinstance(orderings, OrderedDict):
776+
if not isinstance(orderings, dict):
777777
raise TypeError(
778778
"Non-deterministic return value from "
779779
+ str(feature.orderings)
@@ -794,7 +794,7 @@ def orderings(self) -> dict[Apply, list[Apply]]:
794794
return all_orderings[0].copy()
795795
else:
796796
# If there is more than 1 ordering, combine them.
797-
ords: dict[Apply, list[Apply]] = OrderedDict()
797+
ords: dict[Apply, list[Apply]] = {}
798798
for orderings in all_orderings:
799799
for node, prereqs in orderings.items():
800800
ords.setdefault(node, []).extend(prereqs)

0 commit comments

Comments
 (0)