![]() |
weakref.ref which makes wrapped object hashable.
tfp.experimental.lazybones.utils.HashableWeakRef(
referrent, callback=None
)
We take care to ensure that a hash can still be provided in the case that the ref has been cleaned up. This ensures that the WeakKeyDictionary doesn't suffer memory leaks by failing to clean up HashableWeakRef key objects whose referrents have gone out of scope and been destroyed.
Args | |
---|---|
referrent
|
Object that is being referred to. |
callback
|
Optional callback to invoke when object is GCed. |
Methods
__call__
__call__(
*args, **kwargs
)
Call self as a function.
__eq__
__eq__(
other, maybe_negate=(lambda x: x)
)
Return self==value.
__ge__
__ge__(
value, /
)
Return self>=value.
__gt__
__gt__(
value, /
)
Return self>value.
__le__
__le__(
value, /
)
Return self<=value.
__lt__
__lt__(
value, /
)
Return self<value.
__ne__
__ne__(
other
)
Return self!=value.