quchip.utils.values¶
Ownership and cache keys for authored numerical values.
Functions
|
Copy mutable values without detaching native JAX arrays or tracers. |
|
A cache entry |
|
Return if entry holds key and, when scoped, belongs to the current trace. |
|
Hash the contents of supported values; reject opaque mutable payloads. |
Classes
|
Evaluate captured inputs on demand; cache only concrete values. |
|
Cache-key stand-in for a JAX tracer: its identity in the trace that owns it. |
- quchip.utils.values.copy_value(value, *, readonly=False)[source]¶
Copy mutable values without detaching native JAX arrays or tracers.
- class quchip.utils.values.TracedKey(ident)[source]¶
Bases:
objectCache-key stand-in for a JAX tracer: its identity in the trace that owns it.
- quchip.utils.values.value_fingerprint(value, *, traced=False)[source]¶
Hash the contents of supported values; reject opaque mutable payloads.
It rejects a tracer unless
tracedis true. Iftracedis true, the key is the tracer’s identity (TracedKey). Such keys are valid only in the owning trace, so you must scope their cache entries withscoped_entry().
- quchip.utils.values.scoped_entry(key, value, *, traced)[source]¶
A cache entry
(key, scope, value).An entry with a traced value, or with a key that holds a
TracedKey, records the current JAX trace. Such an entry belongs to that trace, and quchip does not reuse it in a nested or later trace. Other entries are valid everywhere.