mirror of
https://github.com/tinygrad/tinygrad.git
synced 2026-01-08 22:48:25 -05:00
diskcache_put
This commit is contained in:
@@ -262,9 +262,9 @@ def diskcache_get(table:str, key:dict|str|bytes|int) -> Any:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
_db_tables = set()
|
_db_tables = set()
|
||||||
def diskcache_put(table:str, key:dict|str|int, val:Any, prepickled=False):
|
def diskcache_put(table:str, key:dict|str|bytes|int, val:Any, prepickled=False):
|
||||||
if CACHELEVEL < 1: return val
|
if CACHELEVEL < 1: return val
|
||||||
if isinstance(key, (str,int)): key = {"key": key}
|
if isinstance(key, (str,bytes,int)): key = {"key": key}
|
||||||
conn = db_connection()
|
conn = db_connection()
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
if table not in _db_tables:
|
if table not in _db_tables:
|
||||||
|
|||||||
Reference in New Issue
Block a user