code: def testTwoSessions(self):
      optimizer = adam.AdamOptimizer()
  
      with context.eager_mode():
          var0 = variables.Variable(np.array([1.0, 2.0]), name="v0")
          grads0 = constant_op.constant(np.array([0.1, 0.1]))
          optimizer.apply_gradients([(grads0, var0)])
  
      g = ops.Graph()
      with g.as_default():
          with session.Session():
              var0 = variables.Variable(np.array([1.0, 2.0]), name="v0")
              grads0 = constant_op.constant(np.array([0.1, 0.1]))
              optimizer.apply_gradients([(grads0, var0)])
  
      gg = ops.Graph()
      with gg.as_default():
          with session.Session():
              var0 = variables.Variable(np.array([1.0, 2.0]), name="v0")
              grads0 = constant_op.constant(np.array([0.1, 0.1]))
  
              # If the optimizer saves any state not keyed by graph the following line
              # fails.
              optimizer.apply_gradients([(grads0, var0)])
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.compiler.xla.experimental import xla_sharding
  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 math_ops
  from tensorflow.python.ops import ref_variable
  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 adam
label_desc: Use image node_id 12 for calling the AdamOptimizerTest obj's underlying member method code with example usage: obj.testTwoSessions() without return types