Skip to content

Commit 0969905

Browse files
committed
.saner defaults
1 parent e330dab commit 0969905

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

pytensor/link/numba/cache.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from numba.core.caching import CacheImpl, _CacheLocator
1212

1313
from pytensor import config
14-
from pytensor.graph.basic import Apply
1514
from pytensor.link.numba.compile import numba_funcify, numba_njit
1615

1716

@@ -65,22 +64,6 @@ def from_function(cls, py_func, py_file):
6564
CacheImpl._locator_classes.insert(0, NumbaPyTensorCacheLocator)
6665

6766

68-
def cache_node_key(node: Apply, extra_key="") -> str:
69-
op = node.op
70-
return sha256(
71-
str(
72-
(
73-
# Op signature
74-
(type(op), op._props_dict() if hasattr(op, "_props_dict") else ""),
75-
# Node signature
76-
tuple((type(inp_type := inp.type), inp_type) for inp in node.inputs),
77-
# Extra key given by the caller
78-
extra_key,
79-
),
80-
).encode()
81-
).hexdigest()
82-
83-
8467
@singledispatch
8568
def numba_funcify_default_op_cache_key(
8669
op, node=None, **kwargs
@@ -109,7 +92,7 @@ def decorator(dispatch_func):
10992
# Create a wrapper for the non-cache dispatcher
11093
@wraps(dispatch_func)
11194
def dispatch_func_wrapper(*args, **kwargs):
112-
func, key = dispatch_func(*args, **kwargs)
95+
func, _key = dispatch_func(*args, **kwargs)
11396
# Discard the key for the non-cache version
11497
return func
11598

@@ -172,7 +155,7 @@ def decorator(dispatch_func):
172155
# Create a wrapper for the non-cache dispatcher
173156
@wraps(dispatch_func)
174157
def dispatch_func_wrapper(*args, **kwargs):
175-
func, key = dispatch_func(*args, **kwargs)
158+
func, _key = dispatch_func(*args, **kwargs)
176159
# Discard the key for the non-cache version
177160
return func
178161

0 commit comments

Comments
 (0)