Return a tuple representing the internal state of the generator.
For more details, see set_state.
Flag indicating to return a legacy tuple state when the BitGenerator is MT19937, instead of a dict. Raises ValueError if the underlying bit generator is not an instance of MT19937.
If legacy is True, the returned tuple has the following items:
pos.has_gauss.cached_gaussian.If legacy is False, or the BitGenerator is not MT19937, then state is returned as a dictionary.
See also
set_state and get_state are not needed to work with any of the random distributions in NumPy. If the internal state is manually altered, the user should know exactly what he/she is doing.
© 2005–2024 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/2.4/reference/random/generated/numpy.random.get_state.html