(key: CacheKeyType, fn: Any, *args: Any, **kwargs: Any)
return result
Memoize ``fn(*args, **kwargs)`` using the given ``key``.
    Results will be stored in the innermost ``cache`` yielded by
    :func:`shared_intermediates`.
Memoize ``fn(*args, **kwargs)`` using the given ``key``.
    Results will be stored in the innermost ``cache`` yielded by
    :func:`shared_intermediates`.
Memoize fn ( * args ** kwargs ) using the given key . Results will be stored in the innermost cache yielded by : func : shared_intermediates .
def _memoize(key: CacheKeyType, fn: Any, *args: Any, **kwargs: Any) -> ArrayType:
    """Memoize ``fn(*args, **kwargs)`` using the given ``key``.
    Results will be stored in the innermost ``cache`` yielded by
    :func:`shared_intermediates`.
    """
    cache = get_sharing_cache()
    if key in cache:
        return cache[key]
    result = fn(*args, **kwargs)
    cache[key] = result
    return result
def _memoize ( key : CacheKeyType , fn : Any , * args : Any , * * kwargs : Any ) -> ArrayType : cache = get_sharing_cache ( ) if key in cache : return cache [ key ] result = fn ( * args , * * kwargs ) cache [ key ] = result return result