提交 a9b35ffe authored 作者: Frederic's avatar Frederic

Move theano flag declaration

上级 d9b0901f
......@@ -1939,9 +1939,6 @@ class _Linker(gof.link.LocalLinker):
if r not in fgraph.inputs]
# Precompute some things for storage pre-allocation
# Need this import here to prevent circular import.
# If we don't do it, we won't always configuration available.
import theano.tests.unittest_tools # noqa
def_val = int(config.unittests.rseed)
#####
......
......@@ -748,3 +748,20 @@ AddConfigVar(
"the first optimization, and could possibly still contains some bugs. "
"Use at your own risks.",
BoolParam(False))
def good_seed_param(seed):
if seed == "random":
return True
try:
int(seed)
except Exception:
return False
return True
AddConfigVar('unittests.rseed',
"Seed to use for randomized unit tests. "
"Special value 'random' means using a seed of None.",
StrParam(666, is_valid=good_seed_param),
in_c_key=False)
......@@ -18,7 +18,7 @@ import numpy
import theano
import theano.tensor as T
from theano.configparser import config, AddConfigVar, StrParam
from theano.configparser import config
try:
from nose.plugins.skip import SkipTest
except ImportError:
......@@ -29,22 +29,6 @@ except ImportError:
_logger = logging.getLogger("theano.tests.unittest_tools")
def good_seed_param(seed):
if seed == "random":
return True
try:
int(seed)
except Exception:
return False
return True
AddConfigVar('unittests.rseed',
"Seed to use for randomized unit tests. "
"Special value 'random' means using a seed of None.",
StrParam(666, is_valid=good_seed_param),
in_c_key=False)
def fetch_seed(pseed=None):
"""
Returns the seed to use for running the unit tests.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论