code: def test_random_state_transfer(self, rng_ctor):
      # Test that random state can be transferred from one pytensor graph to another.
  
      class Graph:
          def __init__(self, seed=123):
              self.rng = RandomStream(seed, rng_ctor=rng_ctor)
              self.y = self.rng.uniform(0, 1, size=(1,))
  
      g1 = Graph(seed=123)
      f1 = function([], g1.y)
      g2 = Graph(seed=987)
      f2 = function([], g2.y)
  
      for su1, su2 in zip(g1.rng.state_updates, g2.rng.state_updates):
          su2[0].set_value(su1[0].get_value())
  
      np.testing.assert_array_almost_equal(f1(), f2(), decimal=6)
  
file_path: pytensor/tests/tensor/random/test_utils.py
imports: import numpy
  import pytest
  from pytensor import config, function
  from pytensor.compile.mode import Mode
  from pytensor.graph.rewriting.db import RewriteDatabaseQuery
  from pytensor.tensor.random.utils import RandomStream, broadcast_params, supp_shape_from_ref_param_shape
  from pytensor.tensor.type import matrix, tensor
  from tests import unittest_tools
label_desc: Use image node_id 7 for calling the TestSharedRandomStream obj's underlying member method code with example usage: obj.test_random_state_transfer(rng_ctor) without return types