提交 ed6c966d authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #4492 from nouiz/fix_crash_gpufft

[CRASH,REGRESSION] Fix crash gpufft
......@@ -63,6 +63,11 @@ kind of abnormal values to monitor. ``nan_is_error`` and ``inf_is_error`` has
no default values, so they need to be set explicitly, but ``big_is_error`` is
set to be ``True`` by default.
.. note::
NanGuardMode significantly slows down computations; only
enable as needed.
Reference
=========
......
......@@ -545,8 +545,8 @@ It will be used repeatedly.
training_steps = 10000
# Declare Theano symbolic variables
x = T.matrix("x")
y = T.vector("y")
x = T.dmatrix("x")
y = T.dvector("y")
# initialize the weight vector w randomly
#
......
......@@ -1425,8 +1425,9 @@ def _gpu_conv_to_fftconv(node):
# we import conv2d_fft locally to avoid pycuda warnings
from theano.sandbox.cuda.fftconv import conv2d_fft
kwargs = {'border_mode': node.op.border_mode}
if (node.op.imshp is not None and node.op.imshp[-1] % 2 == 1 and
node.op.imshp[-1] is not None):
if (node.op.imshp is not None and
node.op.imshp[-1] is not None and
node.op.imshp[-1] % 2 == 1):
kwargs['pad_last_dim'] = True
# If the user supplied the full nonsymbolic image_shape and
......@@ -1455,8 +1456,9 @@ def _gpu_conv_to_fftconv(node):
@local_optimizer([GpuConv])
def local_conv_fft_valid(node):
if isinstance(node.op, GpuConv):
if (node.op.border_mode == 'valid' and node.op.fft_opt and
node.op.subsample == (1, 1)):
if (node.op.border_mode == 'valid' and
node.op.subsample == (1, 1) and
node.op.fft_opt):
return [_gpu_conv_to_fftconv(node)]
return False
......@@ -1465,8 +1467,9 @@ def local_conv_fft_valid(node):
@local_optimizer([GpuConv])
def local_conv_fft_full(node):
if isinstance(node.op, GpuConv):
if (node.op.border_mode == 'full' and node.op.fft_opt and
node.op.subsample == (1, 1)):
if (node.op.border_mode == 'full' and
node.op.subsample == (1, 1) and
node.op.fft_opt):
return [_gpu_conv_to_fftconv(node)]
return
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论