Closed Alphaharrius closed 8 months ago
Another issue during checking if Mode
is memoizable, it seems k
points from different MomentumSpace
will be hashed to the same value if vec(k)
is the same even if getspace(k)
is not.
We cannot add @memoize
to Mode(::Dict)
because Offset
from different RealSpace
of the same euclidean point currently hash to the same value and equals to each other, thus some Mode
will be degenerate and the memoization will give a 'different' Mode
for a given input value.
We will leave the @memoization
application issues to later fixes, but the issue about the Momentum
is included within this fix as it is crucial for some memoized method to work properly.
The memorized API uses
Zipper.MEMORIZED::Dict
which is not thread safe by default, error will be thrown when a memorized function is called since there will be concurrent write attempts toZipper.MEMORIZED
.Detailed error message:
AssertionError: Multiple concurrent writes to Dict detected!
.