tfp.experimental.lazybones.utils.HashableWeakRef

weakref.ref which makes wrapped object hashable.

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.

referrent Object that is being referred to.
callback Optional callback to invoke when object is GCed.

Methods

__call__

Call self as a function.

__eq__

View source

Return self==value.

__ge__

Return self>=value.

__gt__

Return self>value.

__le__

Return self<=value.

__lt__

Return self<value.

__ne__

View source

Return self!=value.