Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pytensor/link/numba/cache.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from collections.abc import Callable
from hashlib import sha256
from pathlib import Path
from pickle import dump
from tempfile import NamedTemporaryFile
from typing import Any
Expand Down Expand Up @@ -64,8 +63,8 @@ def get_disambiguator(self):
@classmethod
def from_function(cls, py_func, py_file):
"""Create a locator instance for functions stored in CACHED_SRC_FUNCTIONS."""
if config.numba__cache and py_func in CACHED_SRC_FUNCTIONS:
return cls(py_func, Path(py_file).parent, CACHED_SRC_FUNCTIONS[py_func])
if py_func in CACHED_SRC_FUNCTIONS and config.numba__cache:
return cls(py_func, py_file, CACHED_SRC_FUNCTIONS[py_func])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Numba wants a string for py_file (to emit warnings)



# Register our locator at the front of Numba's locator list
Expand Down