code: def test_nested_graphs(self):
      if tf.config.functions_run_eagerly():
          self.skipTest("Graph mode test only.")
      x = random_variable.RandomVariable(
          normal.Normal(0, 1), distribution.Distribution.mean, name="rv"
      )
  
      @tf.function(autograph=False, jit_compile=True)
      def run():
          @tf.function(autograph=False, jit_compile=True)
          def _inner():
              return tf.convert_to_tensor(x, name="inner")
  
          y = _inner()
          z = tf.convert_to_tensor(x, name="outer")
          return y, z
  
      with self.assertRaisesRegexp(
          ValueError, r"different graph context"
      ):
          run()
  
file_path: probability/tensorflow_probability/python/experimental/nn/util/random_variable_test.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import bernoulli
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.experimental.nn.util import random_variable
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 5 for calling the RandomVariableTest obj's underlying member method code with example usage: obj.test_nested_graphs() and returns: y,  z, tf