mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
Here's the command I used to invoke autopep8 (in parallel!): git ls-files | grep '\.py$' | xargs -n1 -P`nproc` autopep8 -i Several rules are ignored in setup.cfg. The goal is to let autopep8 handle everything which it can handle safely, and to disable any rules which are tricky or controversial to address. We may want to come back and re-enable some of these rules later, but I'm trying to make this patch as safe as possible. Also configures flake8 to match pep8's behavior. Also configures TravisCI to check the whole project for lint.
38 lines
573 B
Python
38 lines
573 B
Python
from torch import _C
|
|
from . import _lazy_init
|
|
|
|
|
|
def get_rng_state():
|
|
_lazy_init()
|
|
return _C._cuda_getRNGState()
|
|
|
|
|
|
def set_rng_state(new_state):
|
|
_lazy_init()
|
|
return _C._cuda_setRNGState(new_state)
|
|
|
|
|
|
def manual_seed(seed):
|
|
_lazy_init()
|
|
return _C._cuda_manualSeed(seed)
|
|
|
|
|
|
def manual_seed_all(seed):
|
|
_lazy_init()
|
|
return _C._cuda_manualSeedAll(seed)
|
|
|
|
|
|
def seed():
|
|
_lazy_init()
|
|
return _C._cuda_seed()
|
|
|
|
|
|
def seed_all():
|
|
_lazy_init()
|
|
return _C._cuda_seedAll()
|
|
|
|
|
|
def initial_seed():
|
|
_lazy_init()
|
|
return _C._cuda_initialSeed()
|