示例#1
0
def manual_seed(seed):
    r"""Sets the seed for generating random numbers.

    Args:
        seed (int or long): The desired seed.
    """
    _lazy_init()
    return _C._cuda_manualSeed(seed)
示例#2
0
def manual_seed(seed):
    r"""Sets the seed for generating random numbers for the current GPU.
    It's safe to call this function if CUDA is not available; in that
    case, it is silently ignored.

    Args:
        seed (int or long): The desired seed.

    .. warning::
        If you are working with a multi-GPU model, this function is insufficient
        to get determinism.  To seed all GPUs, use :func:`manual_seed_all`.
    """
    _lazy_call(lambda: _C._cuda_manualSeed(seed))
示例#3
0
def manual_seed(seed):
    r"""Sets the seed for generating random numbers for the current GPU.
    It's safe to call this function if CUDA is not available; in that
    case, it is silently ignored.

    Args:
        seed (int): The desired seed.

    .. warning::
        If you are working with a multi-GPU model, this function is insufficient
        to get determinism.  To seed all GPUs, use :func:`manual_seed_all`.
    """
    seed = int(seed)
    _lazy_call(lambda: _C._cuda_manualSeed(seed))
示例#4
0
文件: random.py 项目: zwytop/pytorch
def manual_seed(seed):
    _lazy_init()
    return _C._cuda_manualSeed(seed)