提交 5c2d1670 authored 作者: Frederic Bastien's avatar Frederic Bastien

Add Theano flag conv.assert_shape to easily get rid of the abstract conv assert of shapes.

上级 8b878996
......@@ -693,6 +693,13 @@ import theano and print the config variable, as in:
If ``'False'``, do not use cuDNN or check if it is available.
.. attribute:: config.conv.assert_shape
If False, AbstractConv* ops won't add assert that verify that
the user provided shapes are also the one at run time.
This can speed up compilation time and/or execution time.
.. attribute:: config.dnn.conv.workmem
Deprecated, use :attr:`config.dnn.conv.algo_fwd`.
......
......@@ -126,6 +126,13 @@ AddConfigVar(
BoolParam(False, allow_override=False),
in_c_key=False)
AddConfigVar(
'conv.assert_shape',
"If False, AbstractConv* ops won't add assert that verify that"
" the user provided shapes are also the one at run time",
BoolParam(True),
in_c_key=False)
AddConfigVar(
'print_global_stats',
"Print some global statistics (time spent) at the end",
......
......@@ -493,7 +493,7 @@ def assert_shape(x, expected_shape, msg='Unexpected shape.'):
will return `x` directly.
"""
if expected_shape is None:
if expected_shape is None or not theano.config.conv.assert_shape:
return x
shape = x.shape
tests = []
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论