Skip to content

Commit 33b64d3

Browse files
committed
clean up pytensor.graph.sched
1 parent aba7001 commit 33b64d3

File tree

3 files changed

+12
-284
lines changed

3 files changed

+12
-284
lines changed

pytensor/graph/sched.py

Lines changed: 0 additions & 283 deletions
This file was deleted.

pytensor/tensor/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
from pytensor.graph.basic import Apply, Constant, Variable
44
from pytensor.graph.op import Op
5-
from pytensor.graph.sched import key_to_cmp
65
from pytensor.link.c.type import Generic
76
from pytensor.tensor.type import tensor
7+
from pytensor.utils import key_to_cmp
88

99

1010
class LoadFromDisk(Op):

pytensor/utils.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ def cmp(x, y):
111111
return (x > y) - (x < y)
112112

113113

114+
def key_to_cmp(key):
115+
"""
116+
comparator function based on "key" function
117+
"""
118+
119+
def key_cmp(a, b):
120+
return cmp(key(a), key(b))
121+
122+
return key_cmp
123+
124+
114125
def get_unbound_function(unbound):
115126
# Op.make_thunk isn't bound, so don't have a __func__ attr.
116127
# But bound method, have a __func__ method that point to the

0 commit comments

Comments
 (0)