code: def test_capture_in_outer_function(self):
      x = 1
  
      def g():
          graph = ops.get_default_graph()
          cap_x = graph._experimental_capture_side_input_by_ref(
              "x", lambda: x
          )
          return cap_x + 1
  
      @def_function.function
      def f():
          return g()
  
      self.assertEqual(f(), 2)
      x = 2
      self.assertEqual(f(), 3)
  
file_path: tensorflow-upstream/tensorflow/core/function/capture/by_ref_capture_test.py
imports: import unittest
  from absl.testing import parameterized
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 3 for calling the ByRefCaptureTest obj's underlying member method code with example usage: obj.test_capture_in_outer_function() and returns: unknown, g