提交 bc5b983f authored 作者: Harm de Vries's avatar Harm de Vries

up

上级 0e0fa004
...@@ -1442,6 +1442,13 @@ if (pool%(name)s != NULL) { cudnnDestroyPoolingDescriptor(pool%(name)s); } ...@@ -1442,6 +1442,13 @@ if (pool%(name)s != NULL) { cudnnDestroyPoolingDescriptor(pool%(name)s); }
""" % dict(name=name) """ % dict(name=name)
def c_code(self, node, name, inputs, outputs, sub): def c_code(self, node, name, inputs, outputs, sub):
if len(inputs) == 2:
warnings.warn("Theano GPUDnnPoolGrad internal changed.", stacklevel=3)
desc = inputs[1]
ws = desc.ws
stride = desc.stride
pad = desc.pad
else:
ws = inputs[1] ws = inputs[1]
stride = inputs[2] stride = inputs[2]
pad = inputs[3] pad = inputs[3]
...@@ -1668,7 +1675,15 @@ if (pool%(name)s != NULL) { cudnnDestroyPoolingDescriptor(pool%(name)s); } ...@@ -1668,7 +1675,15 @@ if (pool%(name)s != NULL) { cudnnDestroyPoolingDescriptor(pool%(name)s); }
# Here the name out and inp are based on the cudnn definition. # Here the name out and inp are based on the cudnn definition.
# Not the definition of this class. # Not the definition of this class.
# This make it complicated. # This make it complicated.
if len(inputs) == 4:
warnings.warn("Theano GPUDnnPoolGrad internal changed.", stacklevel=3)
out, inp, inp_grad, desc = inputs
ws = desc.ws
stride = desc.stride
pad = desc.pad
else:
out, inp, inp_grad, ws, stride, pad = inputs out, inp, inp_grad, ws, stride, pad = inputs
out_grad, = outputs out_grad, = outputs
if self.mode == 'max': if self.mode == 'max':
......
...@@ -372,6 +372,7 @@ def test_pooling_with_tensor_vars(): ...@@ -372,6 +372,7 @@ def test_pooling_with_tensor_vars():
out2 = pool_2d_i2n(x, ds=(2, 2), strides=(1, 1), out2 = pool_2d_i2n(x, ds=(2, 2), strides=(1, 1),
pad=(0, 0), pad=(0, 0),
pool_function=T.max) pool_function=T.max)
mode_without_gpu2 = mode_without_gpu.including() mode_without_gpu2 = mode_without_gpu.including()
mode_without_gpu2.check_isfinite = False mode_without_gpu2.check_isfinite = False
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论