code: def graph_memoized(func):
      """
      Like memoized, but keep one cache per default graph.
      """
  
      # TODO it keeps the graph alive
      from ..compat import tfv1
  
      GRAPH_ARG_NAME = "__IMPOSSIBLE_NAME_FOR_YOU__"
  
      @memoized
      def func_with_graph_arg(*args, **kwargs):
          kwargs.pop(GRAPH_ARG_NAME)
          return func(*args, **kwargs)
  
      @functools.wraps(func)
      def wrapper(*args, **kwargs):
          assert GRAPH_ARG_NAME not in kwargs, "No Way!!"
          graph = tfv1.get_default_graph()
          kwargs[GRAPH_ARG_NAME] = graph
          return func_with_graph_arg(*args, **kwargs)
  
      return wrapper
  
file_path: tensorpack/tensorpack/utils/argtools.py
imports: import inspect
  import functools
  from .None import logger
label_desc: Use image node_id 2 for calling a global function with example usage: graph_memoized(func) and returns: wrapper, func, func_with_graph_arg