code: def test_tensorflow_variables(ray_start_2_cpus):
      sess = tf.Session()
      loss, init, _, _ = make_linear_network()
      sess.run(init)
  
      variables = ray.experimental.tf_utils.TensorFlowVariables(
          loss, sess
      )
      weights = variables.get_weights()
  
      for name, val in weights.items():
          weights[name] += 1.0
  
      variables.set_weights(weights)
      assert weights == variables.get_weights()
  
      loss2, init2, _, _ = make_linear_network("w", "b")
      sess.run(init2)
  
      variables2 = ray.experimental.tf_utils.TensorFlowVariables(
          loss2, sess
      )
      weights2 = variables2.get_weights()
  
      for name, val in weights2.items():
          weights2[name] += 2.0
  
      variables2.set_weights(weights2)
      assert weights2 == variables2.get_weights()
      flat_weights = variables2.get_flat() + 2.0
      variables2.set_flat(flat_weights)
      assert_almost_equal(flat_weights, variables2.get_flat())
  
      sess = tf.Session()
      variables3 = ray.experimental.tf_utils.TensorFlowVariables(
          [loss2], sess=sess
      )
      assert variables3.sess == sess
  
imports: from numpy.testing import assert_almost_equal
  import ray
  import ray.experimental.tf_utils
  from ray.rllib.utils.framework import try_import_tf
label_desc: Use image node_id 2 for calling a global function with example usage: test_tensorflow_variables(ray_start_2_cpus) without return types