File tree Expand file tree Collapse file tree 3 files changed +12
-284
lines changed Expand file tree Collapse file tree 3 files changed +12
-284
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
3
3
from pytensor .graph .basic import Apply , Constant , Variable
4
4
from pytensor .graph .op import Op
5
- from pytensor .graph .sched import key_to_cmp
6
5
from pytensor .link .c .type import Generic
7
6
from pytensor .tensor .type import tensor
7
+ from pytensor .utils import key_to_cmp
8
8
9
9
10
10
class LoadFromDisk (Op ):
Original file line number Diff line number Diff line change @@ -111,6 +111,17 @@ def cmp(x, y):
111
111
return (x > y ) - (x < y )
112
112
113
113
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
+
114
125
def get_unbound_function (unbound ):
115
126
# Op.make_thunk isn't bound, so don't have a __func__ attr.
116
127
# But bound method, have a __func__ method that point to the
You can’t perform that action at this time.
0 commit comments