code: def testVariablesAcrossGraphs(self):
      optimizer = momentum_lib.MomentumOptimizer(0.01, 0.5)
      with ops.Graph().as_default():
          var0 = resource_variable_ops.ResourceVariable(
              [1.0, 2.0], dtype=dtypes.float32, name="var0"
          )
          var1 = resource_variable_ops.ResourceVariable(
              [3.0, 4.0], dtype=dtypes.float32, name="var1"
          )
          loss = math_ops.reduce_sum(var0 + var1)
          optimizer.minimize(loss)
          optimizer_variables = optimizer.variables()
          self.assertStartsWith(optimizer_variables[0].name, "var0")
          self.assertStartsWith(optimizer_variables[1].name, "var1")
          self.assertEqual(2, len(optimizer_variables))
  
      with ops.Graph().as_default():
          var2 = resource_variable_ops.ResourceVariable(
              [1.0, 2.0], dtype=dtypes.float32, name="var2"
          )
          var3 = resource_variable_ops.ResourceVariable(
              [3.0, 4.0], dtype=dtypes.float32, name="var3"
          )
          loss = math_ops.reduce_sum(var2 + var3)
          optimizer.minimize(loss)
          optimizer_variables = optimizer.variables()
          self.assertStartsWith(optimizer_variables[0].name, "var2")
          self.assertStartsWith(optimizer_variables[1].name, "var3")
          self.assertEqual(2, len(optimizer_variables))
  
imports: import numpy
  from tensorflow.python.eager import context
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import indexed_slices
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import embedding_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import resource_variable_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
  from tensorflow.python.training import momentum
label_desc: Use image node_id 6 for calling the MomentumOptimizerTest obj's underlying member method code with example usage: obj.testVariablesAcrossGraphs() without return types