pytensor icon indicating copy to clipboard operation
pytensor copied to clipboard

Fix pytensor_cache clear

Open ricardoV94 opened this issue 1 month ago • 0 comments

I noticed cache clear wasn't working and always used purge instead. It was a mistake introduced by 671a821d5d6ce33eb8ff3baa05d392c99da4133f (downstream of https://github.com/aesara-devs/aesara/pull/1312).

This changed many time.time() to to time.perf_counter(). But here it was a mistake. The units are wrong for the logic used in refresh to denote files that are "too old", as it compares the age of a file with the os stats:

https://github.com/pymc-devs/pytensor/blob/8ebff2687c550ec21082d9d2429b79eebab41886/pytensor/link/c/cmodule.py#L369-L375

The whole thing is a bit over-engineered but I don't want to touch it.

ricardoV94 avatar Oct 25 '25 10:10 ricardoV94