I do not know how to access the global state. However, you can use the RandomState object and pass it. Random distributions are attached to it, so you name them as methods.
Example:
import numpy as np def computation(parameter, rs): return parameter*np.sum(rs.uniform(size=5)-0.5) my_state = np.random.RandomState(seed=3) print(computation(3, my_state))
source share