class_docstr: Exploits cons-hashing to do implicit common subexpression elimination.
  
  :param Interpretation base_interpretation: The interpretation to memoize.
  :param dict cache: An optional temporary cache where results will be
      memoized.
class_docstr_tok: ["Exploits","cons-hashing","to","do","implicit","common","subexpression","elimination",".",":","param","Interpretation","base_interpretation",":","The","interpretation","to","memoize",".",":","param","dict","cache",":","An","optional","temporary","cache","where","results","will","be","memoized","."]
code: def __init__(self, base_interpretation, cache=None):
      super().__init__(f"Memoize({base_interpretation.__name__})")
      self.base_interpretation = base_interpretation
      if cache is None:
          cache = {}
      else:
          assert isinstance(cache, dict)
      self.cache = cache
  
imports: from abc import ABC, abstractmethod
  from collections.abc import Hashable
  from contextlib import ContextDecorator, contextmanager
  from timeit import default_timer
  from .None import instrument
  from .interpreter import get_interpretation, pop_interpretation, push_interpretation
  from .registry import KeyedRegistry
  from .util import get_backend
label_desc: Use image node_id 1 to create a new Memoize object from inherited base classes: Interpretation with example: obj = Memoize(base_interpretation, cache)