PyTorch torch.get_rng_state Function
PyTorch torch Reference Manual
torch.get_rng_stateIt is a function in PyTorch used to return the state of the random number generator.
Function Definition
torch.get_rng_state()
Usage Example
Example
import torch
# Get the current random number generator state
rng_state = torch.get_rng_state()
print("Random number generator state:", rng_state)
print("State type:", type(rng_state))
print("State size:", rng_state.numel())
# Get the current random number generator state
rng_state = torch.get_rng_state()
print("Random number generator state:", rng_state)
print("State type:", type(rng_state))
print("State size:", rng_state.numel())
Other Extensions