message: Add a test that includes global. It shows how global is allowed through, but mutations to the global variable are not applied.
diff: @@ -41,6 +41,9 @@ from tensorflow.python.util import tf_inspect
  tf = utils.fake_tf()
  +testing_global_numeric = 2
  +
  +
  class TestResource(str):
  pass
  @@ -496,6 +499,20 @@ class ApiTest(test.TestCase):
  x = compiled_fn(constant_op.constant([4, 8]))
  self.assertListEqual([1, 2], self.evaluate(x).tolist())
  + def test_to_graph_with_globals(self):
  +
  + def test_fn(x):
  + global testing_global_numeric
  + testing_global_numeric = x + testing_global_numeric
  + return testing_global_numeric
  +
  + compiled_fn = api.to_graph(test_fn)
  +
  + x = compiled_fn(constant_op.constant(3))
  + self.assertEqual(5, self.evaluate(x))
  + # TODO(b/122368197): This should be the constant 5!
  + self.assertEqual(2, testing_global_numeric)
  +
  def test_to_code_basic(self):
  def test_fn(x, s):
  