Skip to content

Commit

Permalink
try other way
Browse files Browse the repository at this point in the history
  • Loading branch information
Smit-create committed Mar 10, 2023
1 parent 1c29a6a commit febc082
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions aesara/link/numba/dispatch/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,10 @@ def make_node_key(node):

def check_cache(node_key):
"""Check disk-backed cache."""
return numba_db.get(node_key)
file_name = numba_db.get(node_key)
if file_name:
return dill.load_module(file_name).source
return None


def add_to_cache(node_key, numba_py_fn):
Expand All @@ -396,11 +399,11 @@ def add_to_cache(node_key, numba_py_fn):
cache_module.source = numba_py_fn
dill.dump_module(module_file_base, module=cache_module)

# Load the function from the persisted module
numba_py_fn = dill.load_module(module_file_base).source
# # Load the function from the persisted module
# numba_py_fn = dill.load_module(module_file_base).source

# Add the function to numba_cache database
numba_db[node_key] = numba_py_fn
numba_db[node_key] = module_file_base

return numba_py_fn

Expand Down

0 comments on commit febc082

Please sign in to comment.