Skip to content

Commit 31e42d8

Browse files
authored
Make sure compilation_cache.is_cache_used always returns a bool
In some cases, `compilation_cache.is_cache_used` can reach the end of the function body without returning anything. This amounts to an implicit `return None`, which is not in line with the functions return type of `bool`. We fix this by adding a final `return False` to the function.
1 parent 54e72d5 commit 31e42d8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jax/_src/compilation_cache.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ def is_cache_used(backend: xla_client.Client) -> bool:
8484
_cache_used = True
8585
return _cache_used
8686

87+
return False
88+
8789

8890
def get_file_cache(path: str) -> tuple[CacheInterface, str] | None:
8991
"""Returns the file cache and the path to the cache."""

0 commit comments

Comments
 (0)