Ejemplo n.º 1
0
def set_rng_state(new_state):
    r"""Sets the random number generator state.

    Args:
        new_state (torch.ByteTensor): The desired state
    """
    _lazy_init()
    return _C._cuda_setRNGState(new_state)
Ejemplo n.º 2
0
def set_rng_state(new_state):
    r"""Sets the random number generator state of the current GPU.

    Args:
        new_state (torch.ByteTensor): The desired state
    """
    new_state_copy = new_state.clone()
    _lazy_call(lambda: _C._cuda_setRNGState(new_state_copy))
Ejemplo n.º 3
0
 def cb():
     with device_ctx_manager(device):
         _C._cuda_setRNGState(new_state_copy)
Ejemplo n.º 4
0
def set_rng_state(new_state):
    _lazy_init()
    return _C._cuda_setRNGState(new_state)
 def cb():
     with device(device_id):
         _C._cuda_setRNGState(new_state_copy)
Ejemplo n.º 6
0
 def cb():
     with device_ctx_manager(device):
         _C._cuda_setRNGState(new_state_copy)