提交 365b05d1 authored 作者: lamblin's avatar lamblin

Merge pull request #1423 from nouiz/fixes

Fixes
......@@ -66,7 +66,10 @@
minimum value and 0.997527376843 as the maximum value. So it
never returns 0 or 1.
.. note:: Using directly the ultra_fast_sigmoid in the graph will
disable stabilization optimization associated with it. But
using the optimization to insert them won't disable the
stability optimization.
.. function:: hard_sigmoid(x)
......@@ -84,6 +87,10 @@
.. note:: The underlying code will return an exact 0 or 1 if an
element of x is too small or too big.
.. note:: Using directly the ultra_fast_sigmoid in the graph will
disable stabilization optimization associated with it. But
using the optimization to insert them won't disable the
stability optimization.
.. function:: softplus(x)
......
......@@ -34,7 +34,8 @@ _atexit_print_file = sys.stderr
AddConfigVar('profiling.time_thunks',
"""Time individual thunks when profiling""",
BoolParam(True))
BoolParam(True),
in_c_key=False)
AddConfigVar('profiling.n_apply',
"Number of Apply instances to print by default",
......
......@@ -234,7 +234,8 @@ AddConfigVar('op.set_flops',
AddConfigVar('gpuelemwise.sync',
"when true, wait that the gpu fct finished and check it error code.",
BoolParam(True))
BoolParam(True),
in_c_key=False)
AddConfigVar('traceback.limit',
"The number of stack to trace. -1 mean all.",
......
......@@ -80,7 +80,8 @@ AddConfigVar("compiledir_format",
module subdirectory (relative to base_compiledir).
Available keys: %s. Defaults to %r.
""" % (compiledir_format_keys, default_compiledir_format))),
StrParam(default_compiledir_format, allow_override=False))
StrParam(default_compiledir_format, allow_override=False),
in_c_key=False)
def default_compiledirname():
......@@ -160,7 +161,8 @@ AddConfigVar('base_compiledir',
ConfigParam(
default_base_compiledir,
filter=filter_base_compiledir,
allow_override=False))
allow_override=False),
in_c_key=False)
AddConfigVar('compiledir',
"platform-dependent cache directory for compiled modules",
......@@ -169,7 +171,8 @@ AddConfigVar('compiledir',
config.base_compiledir,
default_compiledirname()),
filter=filter_compiledir,
allow_override=False))
allow_override=False),
in_c_key=False)
def cleanup():
......
......@@ -41,13 +41,19 @@ def test_inter_process_cache():
"""
x, y = theano.tensor.vectors('xy')
x, y = theano.tensor.dvectors('xy')
f = theano.function([x, y], [MyOp()(x), MyOp()(y)])
f(numpy.arange(60), numpy.arange(60))
assert MyOp.nb_called == 1
if theano.config.mode == 'FAST_COMPILE':
assert MyOp.nb_called == 0
else:
assert MyOp.nb_called == 1
# What if we compile a new function with new variables?
x, y = theano.tensor.vectors('xy')
x, y = theano.tensor.dvectors('xy')
f = theano.function([x, y], [MyOp()(x), MyOp()(y)])
f(numpy.arange(60), numpy.arange(60))
assert MyOp.nb_called == 1
if theano.config.mode == 'FAST_COMPILE':
assert MyOp.nb_called == 0
else:
assert MyOp.nb_called == 1
......@@ -20,14 +20,16 @@ logger = logging.getLogger(__name__)
AddConfigVar('profile',
"If VM should collect profile information",
BoolParam(False))
BoolParam(False),
in_c_key=False)
AddConfigVar('profile_optimizer',
"If VM should collect optimizer profile information",
BoolParam(False))
BoolParam(False),
in_c_key=False)
AddConfigVar('profile_memory',
"If VM should collect memory profile information and print it",
BoolParam(False))
BoolParam(False),
in_c_key=False)
def filter_vm_lazy(val):
if val == 'False' or val is False:
......@@ -45,7 +47,8 @@ AddConfigVar('vm.lazy',
" auto detect if lazy evaluation is needed and use the apropriate"
" version. If lazy is True/False, force the version used between"
" Loop/LoopGC and Stack.",
ConfigParam('None', filter_vm_lazy))
ConfigParam('None', filter_vm_lazy),
in_c_key=False)
raise_with_op = link.raise_with_op
......
......@@ -27,7 +27,8 @@ AddConfigVar('cuda.root',
linker directives. Default: environment variable "CUDA_ROOT"
or else "AUTO".
""",
StrParam(os.getenv('CUDA_ROOT', "AUTO")))
StrParam(os.getenv('CUDA_ROOT', "AUTO")),
in_c_key=False)
AddConfigVar('pycuda.init',
"""If True, always initialize PyCUDA when Theano want to
......@@ -37,7 +38,8 @@ AddConfigVar('pycuda.init',
manually by importing theano.misc.pycuda_init before theano
initialize the GPU device.
""",
BoolParam(False))
BoolParam(False),
in_c_key=False)
if config.cuda.root == "AUTO":
# set nvcc_path correctly and get the version
......
......@@ -27,7 +27,8 @@ from theano.configparser import (config, AddConfigVar, StrParam,
AddConfigVar('nvcc.compiler_bindir',
"If defined, nvcc compiler driver will seek g++ and gcc"
" in this directory",
StrParam(""))
StrParam(""),
in_c_key=False)
AddConfigVar('cuda.nvccflags',
"DEPRECATED, use nvcc.flags instead",
......@@ -51,13 +52,21 @@ def filter_nvcc_flags(s):
" nvcc.flags value is '%s'" % s)
return ' '.join(flags)
AddConfigVar('nvcc.flags',
"Extra compiler flags for nvcc",
ConfigParam(config.cuda.nvccflags, filter_nvcc_flags))
"Extra compiler flags for nvcc",
ConfigParam(config.cuda.nvccflags, filter_nvcc_flags),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key=False)
AddConfigVar('nvcc.fastmath',
"",
BoolParam(False))
"",
BoolParam(False),
# Not needed in c key as it is already added.
# We remove it as we don't make the md5 of config to change
# if theano.sandbox.cuda is loaded or not.
in_c_key=False)
nvcc_path = 'nvcc'
nvcc_version = None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论