code: def f_compute(op):
      def result(inp):
          dtype = inp.dtype
          ctx_name = _name_for_ctx(inp.context)
          key = (dtype, ctx_name)
          f = result.cache.get(key, None)
          if f is None:
              guard_in = GpuArrayType(
                  str(dtype), (False,), context_name=ctx_name
              )()
              mode = get_mode("FAST_RUN").including("gpuarray")
              f = theano.function(
                  [guard_in], op(guard_in), mode=mode, profile=False
              )
              result.cache[key] = f
          return f(inp)
  
      result.cache = dict()
      return result
  
file_path: Theano/theano/compile/nanguardmode.py
imports: from __future__ import absolute_import, print_function, division
  import logging
  from six.moves import StringIO
  import numpy
  import theano
  from theano import config
  import theano.tensor
  from theano.compile import Mode
  from theano.compat import ValuesView
  from .mode import get_mode
label_desc: Use image node_id 5 for calling a global function with example usage: f_compute(op) and returns: result, f